diff options
author | jlam <jlam> | 2001-08-22 15:42:17 +0000 |
---|---|---|
committer | jlam <jlam> | 2001-08-22 15:42:17 +0000 |
commit | 53d22483d10376dede18a90adb980d9e5fb451e3 (patch) | |
tree | 5135ef285ff22b1f32de5b33b604fb0ee34de9eb /net/samba | |
parent | 45bf9ae99c6840bd51e57469c1192649905e44c2 (diff) | |
download | pkgsrc-53d22483d10376dede18a90adb980d9e5fb451e3.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')
-rw-r--r-- | net/samba/Makefile | 10 | ||||
-rwxr-xr-x | net/samba/files/nmbd.sh | 25 | ||||
-rw-r--r-- | net/samba/files/samba.sh | 51 | ||||
-rwxr-xr-x | net/samba/files/smbd.sh | 26 | ||||
-rw-r--r-- | net/samba/pkg/PLIST | 5 |
5 files changed, 56 insertions, 61 deletions
diff --git a/net/samba/Makefile b/net/samba/Makefile index 2e67187f90d..37149321a20 100644 --- a/net/samba/Makefile +++ b/net/samba/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.62 2001/07/14 12:37:54 jlam Exp $ +# $NetBSD: Makefile,v 1.63 2001/08/22 15:42:17 jlam Exp $ DISTNAME= samba-2.2.1a WRKSRC= ${WRKDIR}/${DISTNAME}/source @@ -97,10 +97,7 @@ post-extract: ${RM} -r ${WRKDIR}/${DISTNAME}/docs/textdocs/outdated pre-install: - for file in nmbd.sh smbd.sh; do \ - ${SED} ${FILES_SUBST_SED} \ - ${FILESDIR}/$${file} > ${WRKDIR}/$${file}; \ - done + ${SED} ${FILES_SUBST_SED} ${FILESDIR}/samba.sh > ${WRKDIR}/samba.sh ${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE} ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} ${SED} ${FILES_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE} @@ -118,8 +115,7 @@ post-install: ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${EXAMPLESDIR} ${CHMOD} -R ugo-w ${EXAMPLESDIR} - ${INSTALL_SCRIPT} ${WRKDIR}/nmbd.sh ${PREFIX}/etc/rc.d/nmbd - ${INSTALL_SCRIPT} ${WRKDIR}/smbd.sh ${PREFIX}/etc/rc.d/smbd + ${INSTALL_SCRIPT} ${WRKDIR}/samba.sh ${PREFIX}/etc/rc.d/samba ${INSTALL_SCRIPT} ${WRKSRC}/script/convert_smbpasswd ${PREFIX}/sbin ${INSTALL_SCRIPT} ${WRKSRC}/script/mksmbpasswd.sh \ ${PREFIX}/sbin/mksmbpasswd 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" diff --git a/net/samba/pkg/PLIST b/net/samba/pkg/PLIST index ace009396ae..921dd3acdbb 100644 --- a/net/samba/pkg/PLIST +++ b/net/samba/pkg/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.24 2001/07/13 16:08:41 taca Exp $ +@comment $NetBSD: PLIST,v 1.25 2001/08/22 15:42:18 jlam Exp $ bin/make_printerdef bin/make_smbcodepage bin/make_unicodemap @@ -13,8 +13,7 @@ bin/smbstatus bin/smbtar bin/testparm bin/testprns -etc/rc.d/nmbd -etc/rc.d/smbd +etc/rc.d/samba man/man1/findsmb.1 man/man1/make_smbcodepage.1 man/man1/make_unicodemap.1 |