/[gentoo-x86]/net-p2p/bitflu/files/bitflu.initd
Gentoo

Contents of /net-p2p/bitflu/files/bitflu.initd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Thu Jun 30 16:02:44 2011 UTC (3 years, 1 month ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Initial commit

(Portage version: 2.1.9.42/cvs/Linux x86_64)

1 #!/sbin/runscript
2 # Copyright 1999-2011 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: $
5
6 DAEMON=/usr/sbin/bitflu.pl
7 PIDDIR=/var/run/bitflu
8 PIDFILE=${PIDDIR}/bitflu.pid
9 CONFFILE=/etc/bitflu/bitflu.config
10
11 depend() {
12 need net
13 }
14
15 checkconfig() {
16 if [ ! -f ${CONFFILE} ]; then
17 eerror "No config file ${CONFFILE}"
18 return 1
19 fi
20
21 if [ ! -d ${PIDDIR} ] && ! mkdir -p ${PIDDIR}; then
22 eerror "Failed to create ${PIDDIR}"
23 return 1
24 fi
25
26 chown bitflu:bitflu ${PIDDIR}
27 }
28
29 start() {
30 checkconfig || return 1
31 ebegin "Starting bitflu"
32 start-stop-daemon --start --pidfile "${PIDFILE}" --user bitflu:bitflu \
33 --exec "${DAEMON}" -- --config="${CONFFILE}" --daemon -q >/dev/null 2>&1
34 eend $?
35 }
36
37 stop() {
38 ebegin "Stoping bitflu"
39 start-stop-daemon --stop --pidfile "${PIDFILE}" --exec "${DAEMON}"
40 eend $?
41 }
42
43 restart() {
44 svc_stop
45 sleep 2
46 svc_start
47 }

  ViewVC Help
Powered by ViewVC 1.1.20