Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Dec 2022 10:31:52 -0500
From:      Paul Procacci <pprocacci@gmail.com>
To:        Odhiambo Washington <odhiambo@gmail.com>
Cc:        questions <questions@freebsd.org>
Subject:   Re: rc script for a program - detach from tty?
Message-ID:  <CAFbbPui1ah_fFiuAhb4nh7gDQLUMt455dTvBT1b=chdOLca_Qw@mail.gmail.com>
In-Reply-To: <CAAdA2WNitVUyi48LA=i3djL0h0-SARp%2BJJhTs_-hZ__uRf7G6A@mail.gmail.com>
References:  <CAAdA2WPF=1f9zFJFdTgNATRhJ741eHKtGwymsZsG5DGQNU5Xmw@mail.gmail.com> <CAFbbPuh%2BnR088NzPMuXBw8c26mG1OCMVYyXzzksFfLYNv8E5Rw@mail.gmail.com> <CAAdA2WNitVUyi48LA=i3djL0h0-SARp%2BJJhTs_-hZ__uRf7G6A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000003576ff05f05841c3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Here's a snippet of something I wrote for motioneye (
https://github.com/motioneye-project/motioneye)

. /etc/rc.subr

name=3D"motioneye"
rcvar=3D"motioneye_enable"
load_rc_config $name

: ${motioneye_enable:=3D"no"}
: ${motioneye_pid:=3D"/var/run/motioneye/motioneye.pid"}
: ${motioneye_conf:=3D"/usr/local/etc/motioneye/motioneye.conf"}
: ${motioneye_db:=3D"/var/db/motioneye"}
: ${motioneye_suser:=3D"motioneye"}

pidfile=3D"${motioneye_pid}"
procname=3D"/usr/local/bin/meyectl"
command_interpreter=3D"/usr/local/bin/python3"
command=3D"/usr/sbin/daemon"
command_args=3D"-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 '^$|^.*#' =C2=AF\_(=E3=83=84)_/=C2=AF :-)
>


--=20
__________________

:(){ :|:& };:

--0000000000003576ff05f05841c3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Here&#39;s a snippet of something I wrote for motione=
ye (<a href=3D"https://github.com/motioneye-project/motioneye">https://gith=
ub.com/motioneye-project/motioneye</a>)</div><div><br>. /etc/rc.subr<br><br=
>name=3D&quot;motioneye&quot;<br>rcvar=3D&quot;motioneye_enable&quot;<br>lo=
ad_rc_config $name<br><br>: ${motioneye_enable:=3D&quot;no&quot;}<br>: ${mo=
tioneye_pid:=3D&quot;/var/run/motioneye/motioneye.pid&quot;}<br>: ${motione=
ye_conf:=3D&quot;/usr/local/etc/motioneye/motioneye.conf&quot;}<br>: ${moti=
oneye_db:=3D&quot;/var/db/motioneye&quot;}<br>: ${motioneye_suser:=3D&quot;=
motioneye&quot;}</div><div><br></div><div>pidfile=3D&quot;${motioneye_pid}&=
quot;</div>procname=3D&quot;/usr/local/bin/meyectl&quot;<br>command_interpr=
eter=3D&quot;/usr/local/bin/python3&quot;<br>command=3D&quot;/usr/sbin/daem=
on&quot;<br>command_args=3D&quot;-u $motioneye_suser -f -p ${motioneye_pid}=
 $procname startserver -c ${motioneye_conf}&quot;<br><br><div>run_rc_comman=
d &quot;$1&quot;</div><div><br></div><div><br></div><div>I don&#39;t know h=
ow the program you are trying to invoke behaves.<br></div><div>It&#39;s har=
d to provide you with a specific answer due to this.<br></div><div>What hav=
e you tried thus far?=C2=A0 What results are you getting when invoking it?<=
br><br></div><div>~Paul<br></div></div><br><div class=3D"gmail_quote"><div =
dir=3D"ltr" class=3D"gmail_attr">On Wed, Dec 21, 2022 at 10:16 AM Odhiambo =
Washington &lt;<a href=3D"mailto:odhiambo@gmail.com">odhiambo@gmail.com</a>=
&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div=
 dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote"><div=
 dir=3D"ltr" class=3D"gmail_attr">On Wed, Dec 21, 2022 at 6:06 PM Paul Proc=
acci &lt;<a href=3D"mailto:pprocacci@gmail.com" target=3D"_blank">pprocacci=
@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><div dir=3D"ltr"><div>I&#39;m sorry, I just woke up.</div><div><=
br></div><div>daemon(8) will probably work for you.=C2=A0 Not daemon(7).</d=
iv></div></blockquote><div></div></div><div><br></div>I had already read th=
at. And the man page is the same.<div>It&#39;s just that I wasn&#39;t able =
to figure out howto.<br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr=
"><div dir=3D"ltr"><div dir=3D"ltr"><div>Best regards,<br>Odhiambo WASHINGT=
ON,<br>Nairobi,KE<br>+254 7 3200 0004/+254 7 2274 3223<br>&quot;<span style=
=3D"font-size:12.8px">Oh, the cruft.</span><span style=3D"font-size:12.8px"=
>&quot;,=C2=A0</span><span style=3D"font-size:12.8px">egrep -v &#39;^$|^.*#=
&#39;=C2=A0</span><span style=3D"background-color:rgb(34,34,34);color:rgb(2=
38,238,238);font-family:&quot;Lucida Console&quot;,Consolas,&quot;Courier N=
ew&quot;,monospace;font-size:13.6px">=C2=AF\_(=E3=83=84)_/=C2=AF</span><spa=
n style=3D"font-size:12.8px">=C2=A0:-)</span></div></div></div></div></div>=
</div>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature">__________________<br><br>:(){ :|:&amp; };:</div>

--0000000000003576ff05f05841c3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFbbPui1ah_fFiuAhb4nh7gDQLUMt455dTvBT1b=chdOLca_Qw>