Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Aug 2020 09:58:46 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Odhiambo Washington <odhiambo@gmail.com>
Cc:        questions <questions@freebsd.org>
Subject:   Re: creating a startup script for a foreign application
Message-ID:  <20200822095846.a8891dda.freebsd@edvax.de>
In-Reply-To: <CAAdA2WPwwzaP4F2ZTXTAvFAAgXDYk0OiM6fsERbGjMK=s7v0KA@mail.gmail.com>
References:  <CAAdA2WPwwzaP4F2ZTXTAvFAAgXDYk0OiM6fsERbGjMK=s7v0KA@mail.gmail.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Sat, 22 Aug 2020 10:10:46 +0300, Odhiambo Washington wrote:
> Hi good people,
> 
> I am looking for assistance in creating a startup script for rc.d/ to
> automatically start/stop a service upon reboot.
> I have installed Mailman3.x in a python virtual environment and I have
> adopted a script from Linux to control it.
> I am able to use the script to manually start|stop the application.
> However, it does not work when I reboot the system.
> 
> Hoping someone can help me tinker with it so that it works with system
> reboots.

Without having had a closer look, I can immediately see
that it is missing the header typical for all rc.d/ scripts,
and it declares requiring bash, while I don't see anything
bash-specific, so sh should be sufficient. For the general
structure, you could examine scripts in /etc/rc.d/ (system
scripts) and /usr/local/etc/rc.d/ (3rd party scripts). The
REQUIRE: comment should probably contain "DAEMON" and "netif".
Everything else looks quite "Linux-like" and does not really
compare to the FreeBSD equivalents of rc.d/ style scripts,
which first source /etc/rc.subr, sets a few variables, and
then declares functions. You can adapt most of the content
of the Linux-like version to conform to those requirements.


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20200822095846.a8891dda.freebsd>