wok-6.x view dovecot/stuff/init.d/dovecot @ rev 20115

ponyprog-qt: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Oct 12 11:57:57 2017 +0200 (2017-10-12)
parents 0d8a1a3edc72
children 1c049ccf6c26
line source
1 #!/bin/sh
2 # /etc/init.d/dovecot : Start, stop and restart Dovecotserver on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start SSH server at boot time, just put dovecot in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=dovecot
12 DESC="$(_ '%s daemon' Dovecot)"
13 DAEMON=/usr/sbin/dovecot
14 OPTIONS=$dovecot_OPTIONS
15 PIDFILE=/var/run/dovecot/master.pid
17 if [ ! -d /var/run/dovecot ]; then
18 mkdir -p /var/run/dovecot
19 chown dovecot.dovecot /var/run/dovecot
20 fi
21 case "$1" in
22 start)
23 if active_pidfile $PIDFILE dovecot ; then
24 _ '%s is already running.' $NAME
25 exit 1
26 fi
27 action 'Starting %s: %s...' "$DESC" $NAME
28 $DAEMON $OPTIONS
29 status
30 ;;
31 stop)
32 if ! active_pidfile $PIDFILE dovecot ; then
33 _ '%s is not running.' $NAME
34 exit 1
35 fi
36 action 'Stopping %s: %s...' "$DESC" $NAME
37 kill $(cat $PIDFILE)
38 status
39 ;;
40 restart)
41 if ! active_pidfile $PIDFILE dovecot ; then
42 _ '%s is not running.' $NAME
43 exit 1
44 fi
45 action 'Restarting %s: %s...' "$DESC" $NAME
46 kill $(cat $PIDFILE)
47 sleep 2
48 $DAEMON $OPTIONS
49 status
50 ;;
51 *)
52 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
53 newline
54 exit 1
55 ;;
56 esac
58 exit 0