summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Raschbacher <lordvan@gentoo.org>2014-03-07 18:48:33 +0000
committerThomas Raschbacher <lordvan@gentoo.org>2014-03-07 18:48:33 +0000
commit588094a1cd334084be098fef2bb501b6a589f713 (patch)
tree7e4acfe953884c8e258c2fe6e5d78f73d698f2a8 /net-mail/dbmail/files/dbmail-timsieved.initd
parentAdded ebuild for dev-java/dnsjava (wrt bug #181877). (diff)
downloadgentoo-2-588094a1cd334084be098fef2bb501b6a589f713.tar.gz
gentoo-2-588094a1cd334084be098fef2bb501b6a589f713.tar.bz2
gentoo-2-588094a1cd334084be098fef2bb501b6a589f713.zip
removed 3.0.2, added 3.1.12 + new init scripts
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key )
Diffstat (limited to 'net-mail/dbmail/files/dbmail-timsieved.initd')
-rw-r--r--net-mail/dbmail/files/dbmail-timsieved.initd81
1 files changed, 55 insertions, 26 deletions
diff --git a/net-mail/dbmail/files/dbmail-timsieved.initd b/net-mail/dbmail/files/dbmail-timsieved.initd
index 325badb29fd4..83674b8f2767 100644
--- a/net-mail/dbmail/files/dbmail-timsieved.initd
+++ b/net-mail/dbmail/files/dbmail-timsieved.initd
@@ -1,39 +1,68 @@
#!/sbin/runscript
#
+# chkconfig: - 91 35
+# description: Starts and stops dbmail-timsieved
+#
+
+
+PROGRAM=dbmail-timsieved
+
+BIN_DIR=/usr/sbin
+PID_DIR=/var/run/dbmail
+PID=pid
+
+# Where is the dbmail.conf file located?
+CONFIG=/etc/dbmail/dbmail.conf
-PIDFILE="/var/run/dbmail-timsieved.pid"
+## not in 3.1.x yet
+#extra_started_commands="reload"
depend() {
- need net
- use mysql
- use pgsql
- after mta
+ need net
+ # This won't cause a hard failure if neither is installed, however.
+ use mysql
+ use pgsql
+ after mta
}
-checkconfig() {
- if [ ! -e "/etc/dbmail/dbmail.conf" ]; then
- eerror "You need to create apropriate config"
- eerror "in /etc/dbmail/ . Example can be found in /etc/dbmail/dbmail.conf.dist"
- return 1
- fi
- # Avoid using root's TMPDIR
- unset TMPDIR
-}
+initService() {
+ # Avoid using root's TMPDIR
+ unset TMPDIR
+
+ # Check that config file exists.
+ if [ ! -e $CONFIG ]; then
+ eerror "Config file not found ($CONFIG)"
+ eerror "An example config can be found in /etc/dbmail/dbmail.conf.dist"
+ return 1
+ fi
+
+ checkpath -d $PID_DIR -m 750 -o dbmail:dbmail
+ RETVAL=0
+}
start() {
- checkconfig && \
- ebegin "Starting DBMail SIEVE daemon"
- start-stop-daemon --start --quiet \
- --exec /usr/sbin/dbmail-timsieved \
- -- -p ${PIDFILE} -f /etc/dbmail/dbmail.conf 2>&1
- eend $?
-}
+ initService
+ ebegin "Starting DBMail SIEVE daemon ($PROGRAM)"
+ start-stop-daemon --start --quiet \
+ --pidfile $PID_DIR/$PROGRAM.$PID \
+ --exec $BIN_DIR/$PROGRAM \
+ --name $PROGRAM \
+ -- -f $CONFIG -p $PID_DIR/$PROGRAM.$PID 2>&1
+ eend $?
+}
stop() {
- ebegin "Stopping DBMail SIEVE daemon"
- start-stop-daemon --stop --quiet --retry 5 \
- --pidfile ${PIDFILE}
- eend $?
-}
+ ebegin "Stopping DBMail SIEVE daemon ($PROGRAM)"
+ start-stop-daemon --stop --quiet --retry 15 \
+ --pidfile $PID_DIR/$PROGRAM.$PID
+ eend $?
+}
+## not in 3.1.x yet
+#reload() {#
+# ebegin "Reloading DBMail SIEVE daemon ($PROGRAM)"
+# start-stop-daemon --quiet --signal HUP \
+# --pidfile $PID_DIR/$PROGRAM.$PID
+# eend $?
+#}