]> git.pld-linux.org Git - packages/samba.git/blob - smb.init
- missing pl summary, BuildRequires: autoconf
[packages/samba.git] / smb.init
1 #!/bin/sh
2 #
3 # chkconfig:    345 91 35
4 # description:  Starts and stops the Samba smbd and nmbd daemons \
5 #               used to provide SMB network services.
6 #
7 # config:       /etc/samba/smb.conf
8 # config:       /etc/samba/lmhosts
9
10 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
11
12 # Source function library.
13 . /etc/rc.d/init.d/functions
14
15 # Source networking configuration.
16 . /etc/sysconfig/network
17
18 # Demon specified configuration.
19 . /etc/sysconfig/samba
20
21 # Check that networking is up.
22 if is_no "${NETWORKING}"; then
23         msg_Network_Down smb
24         exit 1
25 fi
26
27 TMPDIR="/tmp"; export TMPDIR
28
29 # Check that smb.conf exists.
30 [ -f /etc/samba/smb.conf ] || exit 0
31
32 # See how we were called.
33 case "$1" in
34   start)
35         # Check if the service is already running?
36         if [ ! -f /var/lock/subsys/smb ]; then
37                 msg_starting smbd
38                 daemon $NICELEVEL smbd -D
39                 msg_starting nmbd
40                 daemon $NICELEVEL nmbd -D
41                 RETVAL=$?
42                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/smb
43         else
44                 msg_Already_Running smb
45                 exit 1
46         fi
47         ;;
48   stop)
49         # Stop daemons.
50         if [ -f /var/lock/subsys/smb ]; then
51                 msg_stopping smbd
52                 killproc smbd
53                 msg_stopping nmbd
54                 killproc nmbd
55                 rm -f /var/lock/subsys/smb >/dev/null 2>&1
56         else
57                 msg_Not_Running smb
58                 exit 1
59         fi
60         ;;
61   status)
62         status smbd
63         status nmbd
64         smbstatus
65         exit $?
66         ;;
67   restart)
68         $0 stop
69         $0 start
70         ;;
71   reload)
72         if [ -f /var/lock/subsys/smb ]; then
73                 msg_reloading smb
74                 killproc smbd -HUP
75         else
76                 msg_Not_Running smb
77                 exit 1
78         fi
79         ;;
80   *)
81         msg_Usage "$0 {start|stop|restart|reload|status}"
82         exit 1
83 esac
84
85 exit $RETVAL
This page took 0.057331 seconds and 3 git commands to generate.