Adopting start-stop-daemon in archlinux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



If you use Debian, you might have come across start-stop-daemon. It's
part of the dpkg package and encapsulates all the knowledge, they
learnt when dealing with starting and stopping daemons. It has plenty
of features ranging from:

* handling pidfiles more intimately (checking the pid files content,
verifying that the pid given actually is the executable in question)
* changing UID/GID
* chrooting, nice-ing
* retry starting if daemon dies
* creating pid files when the process doesn't do it, etc, etc.

curl http://clemens.endorphin.org/start-stop-daemon.c | less
if you want to have look for yourself. It's a single C file.

To me handling pid files correctly is the biggest win. The paradigm
used commonly in arch

PID=`pidof -o %PPID /usr/bin/executable`
[ -z "$PID" ] &&  /usr/bin/executable

is flawed and does not work reliably as shown here
https://bugs.archlinux.org/task/17138

I propose to switch to start-stop-daemon and deprecate the method above.

http://clemens.endorphin.org/sshd-start-stop-daemon.diff is an example
of an rc.d script ported to start-stop-daemon. The paradigm -- to my
personal taste -- is clean and simple. The diffstat is negative
LOC-wise.

We could either take the aur/start-stop-daemon packaging which
references dpkg.tar.gz or include into another core package.
start-stop-daemon.c is public domain.
--
Fruhwirth Clemens http://clemens.endorphin.org


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux