listing of daemons running on a unix server
David Bannon
D.Bannon at latrobe.edu.au
Wed Dec 9 21:54:57 GMT 1998
At 03:41 AM 10/12/1998 +1100, Luke Kenneth Casson Leighton wrote:
>PLEASE REPLY TO SAMBA-TECHNICAL, THANKS
>
>is there a way to obtain a list of daemons running? is there a method for
>starting / stopping them?
>
Luke, I a not sure what you are asking, this is a script that I have in
/usr/local/sbin that I use (manually) to stop and start (and gain access to
smb.conf and smbpasswd) samba. Usage at the end.
#!/bin/sh
# Scrip to control Samba server, David Bannon, 14-6-96
#
PATH=/bin:/usr/sbin:/usr/bin
export PATH
case "$1" in
'start')
if [ -f /usr/local/samba/bin/smbd ]
then
/usr/local/samba/bin/smbd -D
/usr/local/samba/bin/nmbd -D
echo "Starting Samba Server"
fi
;;
'conf')
if [ -f /usr/local/samba/lib/smb.conf ]
then
vi /usr/local/samba/lib/smb.conf
fi
;;
'pw')
if [ -f /usr/local/samba/private/smbpasswd ]
then
vi /usr/local/samba/private/smbpasswd
fi
;;
'restart')
psline=`/bin/ps -eo pid,ucomm | fgrep smbd | grep -v grep`
if [ "$psline" != "" ]
then
psline=`/bin/ps -eo pid,ucomm | fgrep smbd | grep -v grep`
if [ "$psline" ]
then
set -- $psline
pid=$1
while [ "$pid" != "" ]
do
/bin/kill -HUP $pid
echo "Restarted pid # $pid"
shift 2
pid=$1
done
fi
fi
;;
'stop')
psline=`/bin/ps x | grep smbd | grep -v grep`
if [ "$psline" != "" ]
then
while [ "$psline" != "" ]
do
psline=`/bin/ps x | fgrep smbd | grep -v grep`
if [ "$psline" ]
then
set -- $psline
pid=$1
/bin/kill -9 $pid
echo "Stopped $pid line = $psline"
sleep 2
fi
done
fi
echo "Stopped Samba servers"
psline=`/bin/ps x | grep nmbd | grep -v grep`
if [ "$psline" ]
then
set -- $psline
pid=$1
/bin/kill -9 $pid
echo "Stopped Name Server "
fi
echo "Stopped Name Servers"
;;
*)
echo "usage: samba {stop | start | conf | pw }"
;;
esac
------------------------------------------------------------
David Bannon D.Bannon at latrobe.edu.au
School of Biochemistry Phone 61 03 9479 2197
La Trobe University, Plenty Rd, Fax 61 03 9479 2467
Bundoora, Vic, Australia, 3083 http://bioserve.latrobe.edu.au
------------------------------------------------------------
..... Humpty Dumpty was pushed !
More information about the samba-ntdom
mailing list