summaryrefslogtreecommitdiff
path: root/net/samba/files
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-08-22 15:42:17 +0000
committerjlam <jlam@pkgsrc.org>2001-08-22 15:42:17 +0000
commitbf6b5a7711a4b9bb2ab18f2dd788498b8a197329 (patch)
tree5135ef285ff22b1f32de5b33b604fb0ee34de9eb /net/samba/files
parent892f28a909ea30c9566e1950ba33293694334385 (diff)
downloadpkgsrc-bf6b5a7711a4b9bb2ab18f2dd788498b8a197329.tar.gz
Consolidate nmbd and smbd rc.d scripts into one "samba" script. Kindly
provided by Luke Mewburn <lukem@wasabisystems.com> with modifications by me to allow running on older NetBSD systems (so any errors in the script are mine alone).
Diffstat (limited to 'net/samba/files')
-rwxr-xr-xnet/samba/files/nmbd.sh25
-rw-r--r--net/samba/files/samba.sh51
-rwxr-xr-xnet/samba/files/smbd.sh26
3 files changed, 51 insertions, 51 deletions
diff --git a/net/samba/files/nmbd.sh b/net/samba/files/nmbd.sh
deleted file mode 100755
index 56c0e1ca41d..00000000000
--- a/net/samba/files/nmbd.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: nmbd.sh,v 1.3 2001/08/17 16:08:20 jlam Exp $
-#
-# PROVIDE: nmbd
-# REQUIRE: DAEMON
-
-name="nmbd"
-command="@PREFIX@/sbin/${name}"
-command_args="-D" # _must_ start as daemon from rc.d;
- # add more flags through ${nmbd_flags}
-
-if [ ! -d /etc/rc.d ]
-then
- @ECHO@ -n ' ${name}'
- exec ${command} ${nmbd_flags} ${command_args}
-fi
-
-. /etc/rc.subr
-
-pidfile="/var/run/samba/${name}.pid"
-required_files="/etc/samba/smb.conf"
-
-load_rc_config $name
-run_rc_command "$1"
diff --git a/net/samba/files/samba.sh b/net/samba/files/samba.sh
new file mode 100644
index 00000000000..b85d6c3c2c1
--- /dev/null
+++ b/net/samba/files/samba.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# $NetBSD: samba.sh,v 1.4 2001/08/22 15:42:18 jlam Exp $
+#
+# PROVIDE: samba
+# REQUIRE: DAEMON
+#
+# nmbd may require DNS to resolve NetBIOS hostnames, and smbd may be acting as
+# a Backup Domain Controller and may need the network to be up, so simply
+# require DAEMON above.
+#
+# To use this script, copy to /etc/rc.d and set samba=YES in /etc/rc.conf.
+# You may also set nmbd_flags and smbd_flags to any additional options you
+# wish to pass to the Samba daemons.
+
+if [ -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+arg="$1"
+rcvar="samba"
+required_files="@SAMBA_ETCDIR@/smb.conf"
+extra_commands="reload"
+command_args="-D" # _must_ start as daemon from rc.d;
+ # add more flags through ${${name}_flags}
+
+name="nmbd"
+command="@PREFIX@/sbin/${name}"
+reload_cmd=":" # avoid dumping debug output on SIGHUP
+
+if [ ! -d /etc/rc.d ]
+then
+ @ECHO@ -n ' ${name}'
+ ${command} ${nmbd_flags} ${command_args}
+else
+ load_rc_config $name
+ run_rc_command "$arg"
+fi
+
+name="smbd"
+command="@PREFIX@/sbin/${name}"
+
+if [ ! -d /etc/rc.d ]
+then
+ @ECHO@ -n ' ${name}'
+ ${command} ${smbd_flags} ${command_args}
+else
+ load_rc_config $name
+ run_rc_command "$1"
+fi
diff --git a/net/samba/files/smbd.sh b/net/samba/files/smbd.sh
deleted file mode 100755
index c30ede85a05..00000000000
--- a/net/samba/files/smbd.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: smbd.sh,v 1.4 2001/08/20 14:01:46 jlam Exp $
-#
-# PROVIDE: smbd
-# REQUIRE: nmbd
-
-name="smbd"
-command="@PREFIX@/sbin/${name}"
-command_args="-D" # _must_ start as daemon from rc.d;
- # add more flags through ${smbd_flags}
-extra_commands="reload"
-
-if [ ! -d /etc/rc.d ]
-then
- @ECHO@ -n ' ${name}'
- exec ${command} ${smbd_flags} ${command_args}
-fi
-
-. /etc/rc.subr
-
-pidfile="/var/run/samba/${name}.pid"
-required_files="/etc/samba/smb.conf"
-
-load_rc_config $name
-run_rc_command "$1"