aboutsummaryrefslogtreecommitdiffstats
path: root/extra/dovecot/dovecot.initd
diff options
context:
space:
mode:
authorMichael Mason <ms13sp@gmail.com>2009-03-05 23:14:38 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-03-06 15:01:19 +0000
commit8d739eb2a582466292cd85a1842bcc0609b4d5f6 (patch)
treea976daf4231f83f6cf312059611d8153abbf9d5d /extra/dovecot/dovecot.initd
parent6d7a5a973b0546c9e9f3e14d5a85c28e899e0261 (diff)
downloadaports-8d739eb2a582466292cd85a1842bcc0609b4d5f6.tar.gz
aports-8d739eb2a582466292cd85a1842bcc0609b4d5f6.tar.bz2
aports-8d739eb2a582466292cd85a1842bcc0609b4d5f6.tar.xz
extra/dovecot Initial Commit
Diffstat (limited to 'extra/dovecot/dovecot.initd')
-rw-r--r--extra/dovecot/dovecot.initd41
1 files changed, 41 insertions, 0 deletions
diff --git a/extra/dovecot/dovecot.initd b/extra/dovecot/dovecot.initd
new file mode 100644
index 0000000000..24201eeecb
--- /dev/null
+++ b/extra/dovecot/dovecot.initd
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+
+# Sample init.d file for alpine linux.
+
+NAME=dovecot
+DAEMON=/usr/sbin/$NAME
+USER=dovecot
+group=dovecot
+
+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 $?
+}
+