[Slackbuilds-users] Starting a daemon in rc

Noryungi noryungi at gmail.com
Fri Mar 10 18:07:19 UTC 2023


Another solution is to put the start command for the daemon in rc.local,
which is usually started last if I remember correctly.

Not an ideal solution, but one that should work. Unless I am wrong, and I
am often wrong.

Le ven. 10 mars 2023 à 17:11, <phalange at komputermatrix.com> a écrit :

> On 2023-03-10 10:06, Ruben Schuller wrote:
> > Hi!
> >
> > 2023-03-10 phalange at komputermatrix.com:
> >
> >> I have slackbuild for tailscale that includes a daemon. The daemon
> >> should ideally be started by the init system. But it requires an
> >> internet connection, and in the case of using wifi, starting this
> >> daemon from rc.local halts the init -- *I think* because it's
> >> searching for a connection before wifi is connected.
> >>
> >> Any suggestions for starting a daemon like this?
> >
> > You could try the "daemon" package for this, it's shipped with
> > Slackware
> > and works pretty well! Here's how I do it for my dendrite SlackBuild
> > (not on SBo yet):
> >
> > ----8<-------------------------------
> > #!/bin/sh
> >
> > if [ -f /etc/default/dendrite ]; then
> >       . /etc/default/dendrite
> > fi
> >
> > dendrite_start() {
> >   if [ -x /usr/bin/dendrite-monolith-server ]; then
> >       daemon -n dendrite -u dendrite -- dendrite-monolith-server-tls-key
> > $TLSKEY -tls-cert $TLSCERT -config /etc/dendrite/dendrite.yaml
> >   fi
> > }
> >
> > dendrite_stop() {
> >       daemon -n dendrite -u dendrite --stop
> > }
> >
> > dendrite_restart() {
> >   dendrite_stop
> >   sleep 1
> >   dendrite_start
> > }
> >
> > case "$1" in
> > 'start')
> >   dendrite_start
> >   ;;
> > 'stop')
> >   dendrite_stop
> >   ;;
> > 'restart')
> >   dendrite_restart
> >   ;;
> > *)
> >   echo "usage $0 start|stop|restart"
> > esac
> > ----8<-------------------------------
> >
> > I'm not sure how to handle the waiting for the network. I suppose you
> > could add something which checks if network manager is connected, but
> > be aware that there are people (myself included) who use the classic
> > Slackware network scripts for this and it wouldn't work. Maybe you
> > could add something which pings the tailscale servers, you are going
> > to connect to them anyway.
> >
> > Cheers
> > Ruben
> > _______________________________________________
> > SlackBuilds-users mailing list
> > SlackBuilds-users at slackbuilds.org
> > https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> > Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> > FAQ - https://slackbuilds.org/faq/
>
> Thanks Ruben, I appreciate the idea. Doesn't this require the user to
> issue a command still?
>
> -AP
> _______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - https://slackbuilds.org/faq/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20230310/61e81dd5/attachment-0001.htm>


More information about the SlackBuilds-users mailing list