wok view dovecot/stuff/init.d/dovecot @ rev 25457

Normazile https://sourceforge.net/projects web_sites
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 23 08:28:09 2022 +0000 (19 months ago)
parents 7f188676b59c
children
line source
1 #!/bin/sh
2 # /etc/init.d/dovecot : Start, stop and restart dovecot server on SliTaz,
3 # at boot time or with the command line.
4 #
5 # To start dovecot 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 ]
18 then
19 mkdir -p /var/run/dovecot
20 chown dovecot.dovecot /var/run/dovecot
21 fi
23 case "$1" in
24 (start)
25 if active_pidfile $PIDFILE dovecot
26 then
27 _ '%s is already running.' $NAME
28 exit 1
29 fi
30 action 'Starting %s: %s...' "$DESC" $NAME
31 $DAEMON $OPTIONS
32 status
33 ;;
34 (stop)
35 if ! active_pidfile $PIDFILE dovecot
36 then
37 _ '%s is not running.' $NAME
38 exit 1
39 fi
40 action 'Stopping %s: %s...' "$DESC" $NAME
41 kill $(cat $PIDFILE)
42 status
43 ;;
44 (restart)
45 if ! active_pidfile $PIDFILE dovecot
46 then
47 _ '%s is not running.' $NAME
48 exit 1
49 fi
50 action 'Restarting %s: %s...' "$DESC" $NAME
51 kill $(cat $PIDFILE)
52 sleep 2
53 $DAEMON $OPTIONS
54 status
55 ;;
56 (*)
57 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
58 newline
59 exit 1
60 ;;
61 esac
63 exit 0