diff options
Diffstat (limited to 'extra/dovecot/dovecot.initd')
-rw-r--r-- | extra/dovecot/dovecot.initd | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/extra/dovecot/dovecot.initd b/extra/dovecot/dovecot.initd new file mode 100644 index 00000000000..24201eeecb2 --- /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 $? +} + |