[Slackbuilds-users] Starting a daemon in rc
sb at rbn.im
Fri Mar 10 15:06:59 UTC 2023
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):
if [ -f /etc/default/dendrite ]; then
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
daemon -n dendrite -u dendrite --stop
case "$1" in
echo "usage $0 start|stop|restart"
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.
More information about the SlackBuilds-users