Re: rc script for a program - detach from tty?
- In reply to: Odhiambo Washington : "Re: rc script for a program - detach from tty?"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 21 Dec 2022 15:31:52 UTC
Here's a snippet of something I wrote for motioneye ( https://github.com/motioneye-project/motioneye) . /etc/rc.subr name="motioneye" rcvar="motioneye_enable" load_rc_config $name : ${motioneye_enable:="no"} : ${motioneye_pid:="/var/run/motioneye/motioneye.pid"} : ${motioneye_conf:="/usr/local/etc/motioneye/motioneye.conf"} : ${motioneye_db:="/var/db/motioneye"} : ${motioneye_suser:="motioneye"} pidfile="${motioneye_pid}" procname="/usr/local/bin/meyectl" command_interpreter="/usr/local/bin/python3" command="/usr/sbin/daemon" command_args="-u $motioneye_suser -f -p ${motioneye_pid} $procname startserver -c ${motioneye_conf}" run_rc_command "$1" I don't know how the program you are trying to invoke behaves. It's hard to provide you with a specific answer due to this. What have you tried thus far? What results are you getting when invoking it? ~Paul On Wed, Dec 21, 2022 at 10:16 AM Odhiambo Washington <odhiambo@gmail.com> wrote: > > > On Wed, Dec 21, 2022 at 6:06 PM Paul Procacci <pprocacci@gmail.com> wrote: > >> I'm sorry, I just woke up. >> >> daemon(8) will probably work for you. Not daemon(7). >> > > I had already read that. And the man page is the same. > It's just that I wasn't able to figure out howto. > > -- > Best regards, > Odhiambo WASHINGTON, > Nairobi,KE > +254 7 3200 0004/+254 7 2274 3223 > "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) > -- __________________ :(){ :|:& };: