Gentoo Archives: gentoo-commits

From: "Bernard Cafarelli (voyageur)" <voyageur@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-ftp/proftpd/files: proftpd.initd
Date: Wed, 17 Feb 2010 12:28:28
Message-Id: E1Nhj10-00028B-1E@stork.gentoo.org
1 voyageur 10/02/17 12:28:26
2
3 Added: proftpd.initd
4 Log:
5 Version bumps, by Bernd Lommerzheim <bernd@×××××××××××.com> in bug #305343. Also fixes bugs #301264 and #301266
6 (Portage version: 2.2_rc62/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 net-ftp/proftpd/files/proftpd.initd
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-ftp/proftpd/files/proftpd.initd?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-ftp/proftpd/files/proftpd.initd?rev=1.1&content-type=text/plain
13
14 Index: proftpd.initd
15 ===================================================================
16 #!/sbin/runscript
17 # Copyright 1999-2010 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header: /var/cvsroot/gentoo-x86/net-ftp/proftpd/files/proftpd.initd,v 1.1 2010/02/17 12:28:25 voyageur Exp $
20
21 opts="reload"
22
23 depend() {
24 need net
25 use logger dns mysql postgresql antivirus
26 }
27
28 check_configuration() {
29 if [ ! -e /etc/proftpd/proftpd.conf ] ; then
30 eerror "To execute the ProFTPD server you need a /etc/proftpd/proftpd.conf configuration"
31 eerror "file. In /etc/proftpd you can find a sample configuration."
32 return 1
33 fi
34 ebegin "Checking ProFTPD configuration"
35 /usr/sbin/proftpd -t
36 eend $? "A configuration error was found. You have to fix your configuration file."
37 }
38
39 start() {
40 [ -d /var/run/proftpd ] || mkdir /var/run/proftpd
41 [ "${RC_CMD}" = "restart" ] || check_configuration || return 1
42 ebegin "Starting ProFTPD"
43 start-stop-daemon --start --quiet \
44 --exec /usr/sbin/proftpd \
45 --pidfile /var/run/proftpd/proftpd.pid
46 eend $?
47 }
48
49 stop() {
50 [ "${RC_CMD}" != "restart" ] || check_configuration || return 1
51 ebegin "Stopping ProFTPD"
52 start-stop-daemon --stop --quiet --retry 20 \
53 --pidfile /var/run/proftpd/proftpd.pid
54 eend $?
55 }
56
57 reload() {
58 if [ ! -f /var/run/proftpd/proftpd.pid ] ; then
59 eerror "ProFTPD is not running."
60 return 1
61 fi
62 check_configuration || return 1
63 ebegin "Reloading ProFTPD"
64 kill -HUP `cat /var/run/proftpd/proftpd.pid` &>/dev/null
65 eend $?
66 }