diff options
author | Javier S. Pedro <javier@javispedro.com> | 2012-07-28 19:10:44 +0200 |
---|---|---|
committer | Javier S. Pedro <javier@javispedro.com> | 2012-07-28 19:10:44 +0200 |
commit | cb01820cb357ba9987359d9b1452fdad16ced373 (patch) | |
tree | 8489254aa78dda5e6523ec091afd5945ac8c7450 | |
parent | 3cdb9f590563b1d8be9263f2db210c48351e0894 (diff) | |
download | rodisc-cb01820cb357ba9987359d9b1452fdad16ced373.tar.gz rodisc-cb01820cb357ba9987359d9b1452fdad16ced373.zip |
add gentoo init scripts
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | rodiscd.init.gentoo | 22 |
2 files changed, 37 insertions, 1 deletions
@@ -1,4 +1,6 @@ CFLAGS?=-O0 -g +CC?=gcc +INSTALL?=install RODISC_PKGCONFIG:=glib-2.0 gobject-2.0 gio-unix-2.0 libsoup-2.4 avahi-gobject RODISC_CFLAGS:=-Wall $(shell pkg-config --cflags $(RODISC_PKGCONFIG)) @@ -15,4 +17,16 @@ rodiscd: rodisc.o udisks.o udisks-device.o clean: rm -f *.o rodiscd -.PHONY: all clean +install: rodiscd + $(INSTALL) -s rodiscd $(DESTDIR)/usr/sbin/rodiscd + +uninstall: + rm -f $(DESTDIR)/usr/sbin/rodiscd + +install-gentoo: install + $(INSTALL) rodiscd.init.gentoo $(DESTDIR)/etc/init.d/rodiscd + +uninstall-gentoo: uninstall + rm -f $(DESTDIR)/etc/init.d/rodiscd + +.PHONY: all clean install uninstall install-gentoo uninstall-gentoo diff --git a/rodiscd.init.gentoo b/rodiscd.init.gentoo new file mode 100644 index 0000000..1541688 --- /dev/null +++ b/rodiscd.init.gentoo @@ -0,0 +1,22 @@ +#!/sbin/runscript + +command="/usr/sbin/${SVCNAME}" +pidfile="/var/run/${SVCNAME}.pid" + +depend() { + need avahi-daemon +} + +start() { + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec "${command}" \ + --pidfile "${pidfile}" --make-pidfile --background + eend $? +} + +stop() { + ebegin "Starting ${SVCNAME}" + start-stop-daemon --stop --exec "${command}" \ + --pidfile "${pidfile}" + eend $? +} |