get start-stop-daemon on any Linux distribution
August 31, 2009 — Florent ClairambaultI switched from Debian to CentOS because I had the choice between an old 32 bits Debian 4.0 or a brand new 64 bits CentOS 5.3. And I have some scripts that use the great “start-stop-daemon” tool, which isn’t available on CentOS.
The easiest way to solve this problem is to get dpkg from Debian and then try to compile it. It’s likely that it will fail because libselinux (and it’s subsidiary library libsepol) won’t be registered in the pkgconfig dir. But we don’t really care as we only need start-stop-daemon, not dpkg.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # wget http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.14.25.tar.gz # tar -xf dpkg_1.14.25.tar.gz # cd dpkg-1.14.25/ # ./configure >/dev/null configure: WARNING: x86_64 not found in cputable configure: WARNING: linux-gnu not found in ostable Package libselinux was not found in the pkg-config search path. Perhaps you should add the directory containing `libselinux.pc' to the PKG_CONFIG_PATH environment variable No package 'libselinux' found configure: WARNING: no curses library found # make >/dev/null processarc.o: In function `process_archive': /root/dpkg-1.14.25/src/processarc.c:166: warning: the use of `tmpnam' is dangerous, better use `mkstemp' archives.o: In function `tarobject': /root/dpkg-1.14.25/src/archives.c:634: undefined reference to `matchpathcon' /root/dpkg-1.14.25/src/archives.c:640: undefined reference to `setfscreatecon' /root/dpkg-1.14.25/src/archives.c:802: undefined reference to `setfscreatecon' /root/dpkg-1.14.25/src/archives.c:804: undefined reference to `freecon' /root/dpkg-1.14.25/src/archives.c:826: undefined reference to `setfscreatecon' /root/dpkg-1.14.25/src/archives.c:618: undefined reference to `is_selinux_enabled' collect2: ld returned 1 exit status make[2]: *** [dpkg] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 # cd utils # make install gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/usr/local/share/locale\" -idirafter ../libcompat -I../lib -g -O2 -MT start-stop-daemon.o -MD -MP -MF .deps/start-stop-daemon.Tpo -c -o start-stop-daemon.o start-stop-daemon.c mv -f .deps/start-stop-daemon.Tpo .deps/start-stop-daemon.Po gcc -std=gnu99 -g -O2 -Wl,-O1 -o start-stop-daemon start-stop-daemon.o ../libcompat/libcompat.a make[1]: Entering directory `/root/dpkg-1.14.25/utils' test -z "/usr/local/sbin" || /bin/mkdir -p "/usr/local/sbin" /usr/bin/install -c 'start-stop-daemon' '/usr/local/sbin/start-stop-daemon' make[1]: Nothing to be done for `install-data-am'. make[1]: Leaving directory `/root/dpkg-1.14.25/utils' |
Even if it doesn’t look so good, it should have installed the start-stop-daemon software.

November 15, 2010 at 12:27 am
[...] If you are like me (not very bright), you will instantly google “setting up nginx with fast_cgi” and like always google will not disappoint you. But this information overload becomes a pain in the back side, sometimes. Why? Well, if something worked for someone does not mean it will work for you and then how long ago was it and has something changed since then and so on and so forth. CentOS has outdated packages and in several cases broken. Also, most of the results you found whilst googling suggest creating a startup script for php with fast_cgi but CentOS, which refers to the use of start-stop-daemon and CentOS does not have one. Therefore, to keep it simple just go with ubuntu. Trust me. Even if you insist on installing CentOS then here are few workarounds. [...]
December 28, 2011 at 7:34 pm
The package is now dpkg_1.14.31.tar.gz
try…
wget http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.14.31.tar.gz
April 14, 2012 at 10:43 am
[...] This helpful post suggested that if you pull the dpkg source from one of the Debian mirrors then you could build it, albeit quite nastily, and end up with a successful build of start-stop-daemon. However, it doesn’t have to build so nastily. Newer versions of dpkg build cleanly, as I discovered and have detailed below. As root or using sudo, do the following: [...]
June 15, 2012 at 6:35 pm
After installing libselinux-devel and ncurses-devel on Centos 6.2, the following worked for me for dpkg 1.16.4.2.
./configure –disable-compiler-warnings –disable-update-alternatives
make -C lib/compat
make -C utils
Then copy start-stop-daemon from the utils directory.
June 25, 2012 at 12:58 pm
thank you. i have found the soultion to solve this prolem, and googling couple of hours. finally this posting make me finish work and i’m home now. have a nice day
January 23, 2013 at 6:39 am
my friend,
does this port of start-stop-daemon tool support the “-k,–umask mask” option ?