Date: Fri, 22 Apr 2016 10:43:04 -0500 From: Kade Cole <kadecole@gmail.com> To: freebsd-rc@freebsd.org Subject: rc startup file questions Message-ID: <CAOR7%2B3jm3h_z-iXj0KPVFrZQGJ=f3Py3gSbnLzg5eEdt2qQOiw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
I am working on a new rc file for starting rtty. I have it working for startup but it is not working for other arguments (status, stop). Part of the problem I am having is that when rtty starts it calls ttysrv for the devices you have configured in /usr/local/rtty/dev and starts a process of ttysrv for each file in /dev. rtty then also creates multiple pid files in /usr/local/rtty/pid for each service started. It seems that I can not figure out how to deal with these multiple pid files. If only one process of ttysrv is started then everything works. If more than one process is started I get the error "WARNING: no shebang line in" the second pid file. I was wondering if anyone has any suggestions on how to write a custom rtty_status or rtty_stop to deal with multiple pid files in a directory. Thanks for your help. Below is the current rc script I have been trying. #!/bin/sh # PROVIDE: rtty # REQUIRE: DAEMON usb # BEFORE: LOGIN # KEYWORD: shutdown . /etc/rc.subr name=rtty rcvar=rtty_enable command="/usr/local/rtty/bin/startsrv" procname="/usr/local/rtty/bin/ttysrv" pidfile="/usr/local/rtty/pid/*" start_cmd="${name}_start" rtty_start(){ echo "starting rtty." cd /usr/local/rtty/dev ${command} * } load_rc_config $name run_rc_command "$1"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOR7%2B3jm3h_z-iXj0KPVFrZQGJ=f3Py3gSbnLzg5eEdt2qQOiw>