summaryrefslogtreecommitdiff
path: root/net/samba/files
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-11-21 16:44:17 +0000
committerjlam <jlam@pkgsrc.org>2001-11-21 16:44:17 +0000
commit16bb385d16c8b0abbb5ad13ac4e18d2e96976727 (patch)
tree4b3cfc0b81c0625c37d33c1d29387c5c7386b705 /net/samba/files
parenta896a9b92a730ad701a514f87820743bbf7bd97b (diff)
downloadpkgsrc-16bb385d16c8b0abbb5ad13ac4e18d2e96976727.tar.gz
Use the general INSTALL/DEINSTALL scripts instead of the homegrown ones.
Also split the one rc.d script into one for each daemon and one admin script (idea from Luke Mewburn <lukem@wasabisystems.com>).
Diffstat (limited to 'net/samba/files')
-rwxr-xr-xnet/samba/files/nmbd.sh30
-rw-r--r--net/samba/files/samba.sh61
-rwxr-xr-xnet/samba/files/smbd.sh28
3 files changed, 87 insertions, 32 deletions
diff --git a/net/samba/files/nmbd.sh b/net/samba/files/nmbd.sh
new file mode 100755
index 00000000000..95c029f60f9
--- /dev/null
+++ b/net/samba/files/nmbd.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $NetBSD: nmbd.sh,v 1.5 2001/11/21 16:44:18 jlam Exp $
+#
+# PROVIDE: nmbd
+# REQUIRE: DAEMON
+
+if [ -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="nmbd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+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}
+
+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 "$1"
+fi
diff --git a/net/samba/files/samba.sh b/net/samba/files/samba.sh
index c087d2f5d50..157abe0028a 100644
--- a/net/samba/files/samba.sh
+++ b/net/samba/files/samba.sh
@@ -1,52 +1,49 @@
#!/bin/sh
#
-# $NetBSD: samba.sh,v 1.5 2001/08/23 04:15:10 jlam Exp $
+# $NetBSD: samba.sh,v 1.6 2001/11/21 16:44: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.
+# KEYWORD: nostart
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}
+# NOTE: run_rc_command sets $_arg
+#
+forward_commands()
+{
+ for file in $COMMAND_LIST; do
+ /etc/rc.d/$file $_arg
+ done
+}
-name="nmbd"
-command="@PREFIX@/sbin/${name}"
-reload_cmd=":" # avoid dumping debug output on SIGHUP
+reverse_commands()
+{
+ REVCOMMAND_LIST=
+ for file in $COMMAND_LIST; do
+ REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
+ done
+ for file in $REVCOMMAND_LIST; do
+ /etc/rc.d/$file $_arg
+ done
+}
-if [ ! -d /etc/rc.d ]
-then
- @ECHO@ -n ' ${name}'
- ${command} ${nmbd_flags} ${command_args}
-else
- load_rc_config $name
- run_rc_command "$arg"
-fi
+COMMAND_LIST="nmbd smbd"
-name="smbd"
-command="@PREFIX@/sbin/${name}"
-reload_cmd= # use default reload command for smbd
+name="samba"
+start_cmd="forward_commands"
+stop_cmd="reverse_commands"
+reload_cmd="forward_commands"
+status_cmd="forward_commands"
+extra_commands="reload status"
if [ ! -d /etc/rc.d ]
then
@ECHO@ -n ' ${name}'
- ${command} ${smbd_flags} ${command_args}
+ _arg="$1"
+ ${start_cmd}
else
- load_rc_config $name
run_rc_command "$1"
fi
diff --git a/net/samba/files/smbd.sh b/net/samba/files/smbd.sh
new file mode 100755
index 00000000000..74b7f8a8c61
--- /dev/null
+++ b/net/samba/files/smbd.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $NetBSD: smbd.sh,v 1.6 2001/11/21 16:44:18 jlam Exp $
+#
+# PROVIDE: smbd
+# REQUIRE: DAEMON
+
+if [ -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="smbd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+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}
+
+if [ ! -d /etc/rc.d ]
+then
+ @ECHO@ -n ' ${name}'
+ ${command} ${smbd_flags} ${command_args}
+else
+ load_rc_config $name
+ run_rc_command "$1"
+fi