From 21cd6680eee14cb6ab89ff95d8ca2413833800c7 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 29 Jan 2009 09:06:43 +0000 Subject: abuild: support for creation of new APKBUILD from template abuild [-c] -n PKGNAME[-PKGVER] creates a directory with new APKBUILD. If -c is specified will sample init.d, conf.d and install script be copied as well. --- sample.initd | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sample.initd (limited to 'sample.initd') diff --git a/sample.initd b/sample.initd new file mode 100644 index 0000000..980c53e --- /dev/null +++ b/sample.initd @@ -0,0 +1,39 @@ +#!/sbin/runscript + +# Sample init.d file for alpine linux. + +NAME= +DAEMON=/usr/sbin/$NAME + +depend() { + need net +} + +start() { + ebegin "Starting ${NAME}" + start-stop-daemon --start --quiet --background \ + --make-pidfile --pidfile /var/run/${NAME}.pid \ + --chuid ${USER}:${GROUP} \ + --exec ${DAEMON} -- ${OPTS} + eend $? +} + +stop() { + ebegin "Stopping ${NAME}" + start-stop-daemon --stop --quiet \ + --exec ${DAEMON} \ + --pidfile /var/run/${NAME}.pid \ + eend $? +} + +reload() { + ebegin "Reloading ${NAME}" + if ! service_started "${NAME}" ; then + eend 1 "${NAME} is not started" + return 1 + fi + start-stop-daemon --stop --oknodo --signal HUP \ + --exec ${DAEMON} --pidfile /var/run/${NAME}.pid + eend $? +} + -- cgit v1.2.3-60-g2f50