summaryrefslogtreecommitdiffstats
path: root/sample.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-29 09:06:43 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-29 09:06:43 +0000
commit21cd6680eee14cb6ab89ff95d8ca2413833800c7 (patch)
treefc0888eb5323e41fa09a05d71ce11bb150de7f9e /sample.initd
parent81f8737a6aa13c1d6944f061a1f21e5549ff4003 (diff)
downloadabuild-21cd6680eee14cb6ab89ff95d8ca2413833800c7.tar.bz2
abuild-21cd6680eee14cb6ab89ff95d8ca2413833800c7.tar.xz
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.
Diffstat (limited to 'sample.initd')
-rw-r--r--sample.initd39
1 files changed, 39 insertions, 0 deletions
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 $?
+}
+