new WHATSNEW for 2.2.7
[Samba.git] / packaging / HPUX / samba.boot
bloba0d55d7d76670018b6308ecdd1e3e926bcf621de
2 SUCCESS=0
3 FAILURE=1
4 exitval=$SUCCESS
7 KillProcess()
9   proc=$1
10   sig=$2
12   # Determine PID of process(es) to stop and kill it.  This routine
13   # is designed to work with bourne shell, ksh and posix shell.
15   Command=`basename $proc | cut -c1-8`     # Solaris ps limited to 8 chars.
17   pid=`ps -e | awk "\\$NF~/$Command/ {print \\$1}"`
19   if [ "X$pid" != "X" ]; then
20     kill -$sig $pid
21   fi
24 if [ ! -f /etc/rc.config.d/samba ]
25 then
26     echo "ERROR: Config file /etc/rc.config.d/samba missing."
27     exit $FAILURE
30 . /etc/rc.config.d/samba
32 case $1 in
33     'start_msg')
34         echo "Start Samba Services"
35         ;;
37     'stop_msg')
38         echo "Stop Samba Services"
39         ;;
41     'start')
42         # Starting Samba is easy ...
43         if [ "$SAMBA_START" -eq 1 ]
44         then
45             if [ -x /usr/local/samba/bin/smbd ]
46             then
47                 /usr/local/samba/bin/smbd -D -d $SAMBA_DEBUG
48             fi
50             if [ -x /usr/local/samba/bin/nmbd ]
51             then
52                 /usr/local/samba/bin/nmbd -D -d $SAMBA_DEBUG
53             fi
54         fi
55         ;;
57     'stop')
58         #
59         # ... stopping it, however, is another story
60         #
61         KillProcess nmbd TERM
62         KillProcess smbd TERM
63         ;;
65     *)
66         echo "usage: $0 {start|stop|start_msg|stop_msg}"
67         exitval=$FAILURE
68         ;;
69 esac
71 exit $exitval