summaryrefslogtreecommitdiff
path: root/packaging/Caldera/OpenLinux/samba.init
blob: 37955e15558d65b530ce270bc3d63fcd14ac6050 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
#
# description: Starts and stops the Samba smbd and nmbd daemons
#	       used to provide SMB network services.

NAME_S=smbd
DAEMON_S=/usr/sbin/$NAME_S
NAME_N=nmbd
DAEMON_N=/usr/sbin/$NAME_N
NAME_W=winbindd
DAEMON_W=/usr/sbin/winbindd

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# See how we were called.
case "$1" in
 start)
  [ -e $SVIlock ] && exit 1
  [ ${NETWORKING} = "no" ] && exit 2
  [ -x $DAEMON_S -a -x $DAEMON_N ] || exit 2

  #[ "$CONFIGURED"  != "no" -a "$CONFIGURED"  != "false" ] || {
  SVIemptyConfig /etc/samba.d/smb.conf && {
    echo "$DESCRIPTIVE: not configured! Skipped..."
    exit 2
  }

  echo -n "Starting $IDENT: "
  ssd -S -n $NAME_S -x $DAEMON_S -- $OPTIONS_SMB
  ssd -S -n $NAME_N -x $DAEMON_N -- $OPTIONS_NMB
  ssd -S -n $NAME_W -x $DAEMON_W -- $OPTIONS_WINBD

  echo "."
  touch $SVIlock
  ;;

 stop)
  [ -e $SVIlock ] || exit 0

  echo -n "Stopping $IDENT: "
  ssd -K -p /var/lock/samba.d/$NAME_W.pid -n $NAME_W #-x $DAEMON_W
  ssd -K -p /var/lock/samba.d/$NAME_N.pid -n $NAME_N #-x $DAEMON_N
  ssd -K -p /var/lock/samba.d/$NAME_S.pid -n $NAME_S #-x $DAEMON_S

  echo "."
  rm -f $SVIlock
  ;;

 restart)
  echo -n "Restarting $IDENT: "
  $0 stop
  $0 start
  exit $?
  ;;

 *)
  echo "Usage: $SVIscript {start|restart|stop}"
  exit 1
  ;;
esac

exit 0