From owner-freebsd-ports Mon Jul 2 11:10:19 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4D7FE37B409 for ; Mon, 2 Jul 2001 11:10:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f62IA5x06766; Mon, 2 Jul 2001 11:10:05 -0700 (PDT) (envelope-from gnats) Received: from m-net.arbornet.org (m-net.arbornet.org [209.142.209.161]) by hub.freebsd.org (Postfix) with ESMTP id 0653F37B406 for ; Mon, 2 Jul 2001 11:07:08 -0700 (PDT) (envelope-from jp2@m-net.arbornet.org) Received: (from jp2@localhost) by m-net.arbornet.org (8.11.2/8.11.2) id f62I8iS85964; Mon, 2 Jul 2001 14:08:44 -0400 (EDT) (envelope-from jp2) Message-Id: <200107021808.f62I8iS85964@m-net.arbornet.org> Date: Mon, 2 Jul 2001 14:08:44 -0400 (EDT) From: howardjp@well.com Reply-To: howardjp@well.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/28643: Improved version of samba.sh.sample that includes restart Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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