Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jul 2001 14:08:44 -0400 (EDT)
From:      howardjp@well.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/28643: Improved version of samba.sh.sample that includes restart
Message-ID:  <200107021808.f62I8iS85964@m-net.arbornet.org>

next in thread | raw e-mail | index | archive | help

>Number:         28643
>Category:       ports
>Synopsis:       Improved version of samba.sh.sample that includes restart
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 02 11:10:04 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     James Howard
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Wavix, Inc.
>Environment:

N/A

>Description:

The Samba startup file, samba.sh.sample, does not include a restart
command.  I took the idled start command and modified it for Samba.  An
appropriate diff has been attatched.

>How-To-Repeat:

N/A

>Fix:

--- samba.sh.sample.orig        Mon Jul  2 09:57:14 2001
+++ samba.sh.sample     Mon Jul  2 09:57:50 2001
@@ -4,19 +4,31 @@
 smbd=/usr/local/sbin/smbd
 nmbd=/usr/local/sbin/nmbd
 
-# start
-if [ "x$1" = "x" -o "x$1" = "xstart" ]; then
-       if [ -f $smbd ]; then
+case "$1" in
+        stop)
+                killall -TERM smbd
+               killall -TERM nmbd
+                echo "Samba stopped"
+                ;;
+        restart)
+                killall -TERM smbd
+               killall -TERM nmbd
                if [ -d $smbspool ]; then
                        rm -f $smbspool/*
                fi
-               echo -n ' Samba'
                $smbd -D
                $nmbd -D
-       fi
-
-# stop
-elif [ "x$1" = "xstop" ]; then
-       kill `cat $pidfiledir/smbd.pid`
-       kill `cat $pidfiledir/nmbd.pid`
-fi
+                echo "Samba restarted"
+                ;;
+        -h)
+                echo "Usage: `basename $0` { start | stop | restart }"
+                ;;
+        *)
+               if [ -d $smbspool ]; then
+                       rm -f $smbspool/*
+               fi
+               $smbd -D
+               $nmbd -D
+                echo -n ' Samba'
+                ;;
+esac
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107021808.f62I8iS85964>