]> git.pld-linux.org Git - packages/rsync.git/blame - rsync.init
- massive attack s/pld.org.pl/pld-linux.org/
[packages/rsync.git] / rsync.init
CommitLineData
f2499957
PG
1#!/bin/sh
2#
3# rsyncd This shell script takes care of starting and stopping rsyncd
4#
8d37145d 5# chkconfig: 345 90 25
f2499957
PG
6# description: rsync daemon
7# processname: rsync
8#
9# pidfile: /var/run/rsyncd.pid
10
11# Source function library.
12. /etc/rc.d/init.d/functions
13
14# Source networking configuration.
15. /etc/sysconfig/network
16
17# Check that networking is up.
8d37145d 18if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network ]; then
20 msg_network_down rsyncd
21 exit 1
22 fi
23else
24 exit 0
f2499957
PG
25fi
26
27. /etc/sysconfig/rsyncd
28
29# See how we were called.
30case "$1" in
31 start)
8d37145d 32 # Start daemons.
f2499957
PG
33 if [ ! -f /var/lock/subsys/rsyncd ]; then
34 msg_starting rsyncd
35 daemon rsync --daemon
36 RETVAL=$?
37 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rsyncd
38 else
39 msg_already_running rsyncd
8d37145d 40 exit 1
f2499957
PG
41 fi
42 ;;
43 stop)
44 # Stop daemons.
45 if [ -f /var/lock/subsys/rsyncd ]; then
46 msg_stopping rsyncd
47 killproc rsync
48 rm -f /var/lock/subsys/rsyncd >/dev/null 2>&1
49 else
50 msg_not_running rsyncd
51 exit 1
52 fi
53 ;;
8d37145d 54 restart|reload)
f2499957
PG
55 $0 stop
56 $0 start
57 ;;
58 status)
a9198766 59 status rsync
f2499957
PG
60 ;;
61 *)
8d37145d 62 msg_usage "$0 {start|stop|restart|reload|status}"
f2499957
PG
63 exit 1
64esac
This page took 0.23709 seconds and 4 git commands to generate.