]> git.pld-linux.org Git - packages/bootparamd.git/blob - bootparamd.init
- check if portmapper is running
[packages/bootparamd.git] / bootparamd.init
1 #! /bin/sh
2 #
3 # chkconfig:    - 60 20
4 # description:  The bootparamd server allows older Sun workstations to \
5 #               net boot from Linux boxes. It (along with rarp) is rarely \
6 #               used anymore; bootp and dhcp have mostly replaced both of them.
7 # processname:  rpc.bootparamd
8 # config:       /etc/bootparams
9
10 # Source function library.
11 . /etc/rc.d/init.d/functions
12
13 # Get config.
14 . /etc/sysconfig/network
15
16 # Check that networking is up.
17 if is_yes "${NETWORKING}"; then
18         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19                 msg_network_down rpc.bootparamd
20                 exit 1
21         fi
22 else
23         exit 0
24 fi
25
26 if [ "$1" != "stop" ]; then
27         check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
28 fi
29
30 RETVAL=0
31 # See how we were called.
32 case "$1" in
33   start)
34         # Check if the service is already running?
35         if [ ! -f /var/lock/subsys/rpc.bootparamd ]; then
36                 msg_starting rpc.bootparamd
37                 daemon rpc.bootparamd
38                 touch /var/lock/subsys/rpc.bootparamd
39                 RETVAL=$?
40                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rpc.bootparamd
41         else
42                 msg_already_running rpc.bootparamd
43         fi
44         ;;
45   stop)
46         if [ -f /var/lock/subsys/rpc.bootparamd ]; then
47                 msg_stopping rpc.bootparamd
48                 killproc rpc.bootparamd
49                 rm -f /var/lock/subsys/rpc.bootparamd >/dev/null 2>&1
50         else
51                 msg_not_running rpc.bootparamd
52         fi
53         ;;
54   status)
55         status rpc.bootparamd
56         exit $?
57         ;;
58   restart|force-reload)
59         $0 stop
60         $0 start
61         exit $?
62         ;;
63   *)
64         msg_usage "$0 {start|stop|restart|force-reload|status}"
65         exit 3
66         ;;
67 esac
68
69 exit $RETVAL
This page took 0.051529 seconds and 3 git commands to generate.