Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jul 2001 09:39:04 -0700 (PDT)
From:      James Howard <howardjp@well.com>
To:        "David W. Chapman Jr." <dwcjr@inethouston.net>
Cc:        freebsd-ports@FreeBSD.org, dwcjr@FreeBSD.org
Subject:   Re: ports/28643: Improved version of samba.sh.sample that includes restart
Message-ID:  <Pine.GSO.4.21.0107040936450.15757-100000@well.com>
In-Reply-To: <20010704011745.A11575@leviathan.inethouston.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 4 Jul 2001, David W. Chapman Jr. wrote:

> Patching file samba.sh.sample using Plan A...
> Hunk #1 failed at 4.
> 1 out of 1 hunks failed--saving rejects to samba.sh.sample.rej
> Hmm...  Ignoring the trailing garbage.
> done
> 
> It does this for both samba ports.

Interesting.  I took it off to a different FreeBSD system and got the same
results.  Here is one I tested several places and it works fine.  It is
the same code, just a new diff.

Before this is committed, would it make sense to break out the start and
stop code into functions?  I have seen some start up scripts do this, but
cannot find any right now.

--- samba.sh.sample.orig	Wed Jul  4 10:43:40 2001
+++ samba.sh.sample	Wed Jul  4 10:50:23 2001
@@ -4,20 +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
-                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
-
+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
+		$smbd -D
+		$nmbd -D
+		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


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?Pine.GSO.4.21.0107040936450.15757-100000>