summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorShaun Amott <shaun@FreeBSD.org>2006-09-19 01:39:21 +0000
committerShaun Amott <shaun@FreeBSD.org>2006-09-19 01:39:21 +0000
commitc9e8541afc050fd599304ab025c4401f778e7a56 (patch)
tree54bc0270be2cbd3b79a92518543af7df69463e9e /net
parentAdd RUN_DEPENDS of gcc41 for amd64. (diff)
- Maintainer reports: [1]
After recent release of Samba 3.0.23c and corresponding version of port several problems with it were reported back by the users. - Fix for the broken OPTIONS menu due overlong line. That addresses PR ports/103158 and ports/102980 - Fix build on FreeBSD 7. PR ports/102919. - Several fixes to the rc.d/samba script, as well as a new code. Should handle 'restart' properly now. - Remove enforcement of a daemon shutdown during deinstallation due several requests. - SAMBA_PRIVATEDIR can now be redefined. - Warn the user if FAM_SUPPORT is enabled contrary to the selected OPTIONS. [2] PR: ports/103170 [1] ports/103276 [2] Submitted by: Timur I. Bakeyev <timur@gnu.org> (mainainer) [1], Scot Hetzel <swhetzel@gmail.com> [2] Approved by: maintainer [2]
Notes
Notes: svn path=/head/; revision=173367
Diffstat (limited to 'net')
-rw-r--r--net/samba3/Makefile22
-rw-r--r--net/samba3/files/patch-include_includes.h16
-rw-r--r--net/samba3/files/samba.in192
3 files changed, 138 insertions, 92 deletions
diff --git a/net/samba3/Makefile b/net/samba3/Makefile
index 13be83c679f6..113a7d4c8692 100644
--- a/net/samba3/Makefile
+++ b/net/samba3/Makefile
@@ -1,6 +1,6 @@
# New ports collection makefile for: samba
# Date created: 11th Feb 1995
-# Whom: Gary Palmer <gpalmer@FreeBSD.org>
+# Whom: Gary Palmer <gpalmer>
#
# $FreeBSD$
#
@@ -36,7 +36,7 @@ SAMBA_SWATDIR= ${PREFIX}/share/swat
# DEPRECATED: This is an old location of the private dir
SAMBA_PRIVATE?= ${PREFIX}/private
SAMBA_CONFDIR?= ${PREFIX}/etc
-SAMBA_PRIVATEDIR= ${SAMBA_CONFDIR}/samba
+SAMBA_PRIVATEDIR?= ${SAMBA_CONFDIR}/samba
SAMBA_CONFIG= smb.conf
SAMBA_LIB= lib
SAMBA_LIBDIR= ${PREFIX}/${SAMBA_LIB}
@@ -71,8 +71,8 @@ OPTIONS= LDAP "With LDAP support" on \
UTMP "With UTMP accounting support" on \
MSDFS "With MSDFS support" off \
SMBSH "With SMBSH wrapper for UNIX commands" off \
- PAM_SMBPASS "With PAM authentication against passdb backend(s)" off \
- EXP_MODULES "With experimental module(s)" off \
+ PAM_SMBPASS "With PAM authentication vs passdb backends" off \
+ EXP_MODULES "With experimental modules" off \
POPT "With system-wide POPT library" on
.endif
@@ -299,6 +299,10 @@ SUB_LIST+= SAMBA_LOGDIR=${SAMBA_LOGDIR} \
SAMBA_PRIVATE=${SAMBA_PRIVATE}
pre-everything::
+.if defined(WANT_FAM_SYSTEM)
+ @${ECHO_CMD} "===> NOTICE: ${WANT_FAM_SYSTEM} detected, forcing FAM_SUPPORT"
+ @${ECHO_CMD} ""
+.endif
@${ECHO_CMD} "===> NOTICE: This version of port has changed location of Samba password"
@${ECHO_CMD} "===> NOTICE: (smbpasswd) directory. Files in '${SAMBA_PRIVATE}'"
@${ECHO_CMD} "===> NOTICE: have moved to '${SAMBA_PRIVATEDIR}'."
@@ -372,16 +376,6 @@ post-install:
@for d in `${FIND} ${SAMBA_MODULEDIR} -type d | ${SORT} -r`; do \
${ECHO_CMD} "@unexec ${RMDIR} $$d 2>/dev/null || true" >> ${TMPPLIST}; \
done
-# Taken from bsd.port.mk
-.if (${OSVERSION} >= 700007 || ( ${OSVERSION} < 700000 && ${OSVERSION} >= 600101 ))
- @for i in ${USE_RC_SUBR}; do \
- ${ECHO_CMD} "@unexec %D/etc/rc.d/$${i%.sh} forcestop 2>/dev/null || true" >> ${TMPPLIST}; \
- done
-.else
- @for i in ${USE_RC_SUBR}; do \
- ${ECHO_CMD} "@unexec %D/etc/rc.d/$${i%.sh}.sh forcestop 2>/dev/null || true" >> ${TMPPLIST}; \
- done
-.endif
# Documentation
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
diff --git a/net/samba3/files/patch-include_includes.h b/net/samba3/files/patch-include_includes.h
new file mode 100644
index 000000000000..a9ae02a59eaf
--- /dev/null
+++ b/net/samba3/files/patch-include_includes.h
@@ -0,0 +1,16 @@
+--- include/includes.h.orig Wed Aug 23 18:16:38 2006
++++ include/includes.h Fri Sep 8 00:12:44 2006
+@@ -475,10 +475,10 @@
+ #undef HAVE_LDAP
+ #endif
+
+-#if HAVE_GSSAPI_H
+-#include <gssapi.h>
+-#elif HAVE_GSSAPI_GSSAPI_H
++#if HAVE_GSSAPI_GSSAPI_H
+ #include <gssapi/gssapi.h>
++#elif HAVE_GSSAPI_H
++#include <gssapi.h>
+ #elif HAVE_GSSAPI_GSSAPI_GENERIC_H
+ #include <gssapi/gssapi_generic.h>
+ #endif
diff --git a/net/samba3/files/samba.in b/net/samba3/files/samba.in
index 407dd02019ec..767accc7d4bb 100644
--- a/net/samba3/files/samba.in
+++ b/net/samba3/files/samba.in
@@ -9,109 +9,145 @@
%%CUPSD%%# REQUIRE: cupsd
# BEFORE: LOGIN
# KEYWORD: shutdown
-
#
-# Add the following lines to /etc/rc.conf to enable samba:
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
#
#samba_enable="YES"
-#
-# or, for fine grain control
-#
+# or, for fine grain control:
#nmbd_enable="YES"
#smbd_enable="YES"
%%WINBIND%%# You need to enable winbindd separately, by adding:
%%WINBIND%%#winbindd_enable="YES"
#
+# Configuration file can be set with:
+#samba_config="%%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%%"
+#
. %%RC_SUBR%%
-name=samba
-rcvar=`set_rcvar`
-samba_enable=${samba_enable="NO"}
-testparm_command="%%PREFIX%%/bin/testparm"
-samba_parm="${testparm_command} -s -v --parameter-name"
+name="samba"
+rcvar=$(set_rcvar)
-load_rc_config $name
-# Set defaults
+load_rc_config "${name}"
+# Custom commands
+extra_commands="reload status"
+start_precmd="samba_start_precmd"
+start_cmd="samba_cmd"
+stop_cmd="samba_cmd"
+status_cmd="samba_cmd"
+restart_precmd="samba_checkconfig"
+reload_precmd="samba_checkconfig"
+reload_cmd="samba_reload_cmd"
+rcvar_cmd="samba_rcvar_cmd"
+# Defaults
+samba_enable=${samba_enable:="NO"}
samba_config=${samba_config="%%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%%"}
-# Config file is required
-if [ ! -r ${samba_config} ]; then
- warn "${samba_config} is not readable."
- case $1 in
- force*) : ;;
- *) exit 1 ;;
- esac
-fi
-
-samba_idmap=`${samba_parm} 'idmap uid' ${samba_config} 2>/dev/null`
-samba_lockdir=`${samba_parm} 'lock directory' ${samba_config} 2>/dev/null`
-
-if test -n ${samba_enable="NO"} && checkyesno samba_enable; then
+samba_daemons="nmbd smbd"
+%%WINBIND%%samba_daemons="${samba_daemons} winbindd"
+testparm_command="%%PREFIX%%/bin/testparm"
+smbcontrol_command="%%PREFIX%%/bin/smbcontrol"
+# Fetch parameters from configuration file
+samba_parm="${testparm_command} -s -v --parameter-name"
+%%WINBIND%%samba_idmap=$(${samba_parm} 'idmap uid' ${samba_config} 2>/dev/null)
+samba_lockdir=$(${samba_parm} 'lock directory' ${samba_config} 2>/dev/null)
+# Setup slave variables
+if [ -n "${samba_enable}" ] && checkyesno samba_enable; then
nmbd_enable=${nmbd_enable="YES"}
smbd_enable=${smbd_enable="YES"}
-%%WINBIND%% # Check that winbind is actually configured
-%%WINBIND%% if [ -n ${samba_idmap} ]; then
-%%WINBIND%% winbindd_enable="YES"
+%%WINBIND%% # Check that winbindd is actually configured
+%%WINBIND%% if [ -n "${samba_idmap}" ]; then
+%%WINBIND%% winbindd_enable=${winbindd_enable="YES"}
%%WINBIND%% fi
fi
+# Defaults for slave variables
+nmbd_enable=${nmbd_enable:="NO"}
+nmbd_flags=${nmbd_flags="-D"}
+smbd_enable=${smbd_enable:="NO"}
+smbd_flags=${smbd_flags="-D"}
+%%WINBIND%%winbindd_enable=${winbindd_enable:="NO"}
+%%WINBIND%%winbindd_flags=${winbindd_flags=""}
+# Requirements
+required_files="${samba_config}"
+required_dirs="${samba_lockdir}"
+command_args="${samba_config:+"-s ${samba_config}"}"
+#"
+samba_checkconfig() {
+ echo -n "Performing sanity check on Samba configuration: "
+ if ${testparm_command} -s ${samba_config} >/dev/null 2>&1; then
+ echo "OK"
+ else
+ echo "FAILED"
+ return 1
+ fi
+}
-nmbd_precmd() {
+samba_start_precmd() {
# XXX: Never delete winbindd_idmap, winbindd_cache and group_mapping
- echo -n "Starting Samba "
- if [ -d ${samba_lockdir} ]; then
- echo -n "- removing stale tdbs: "
- for file in connections.tdb messages.tdb sessionid.tdb \
- unexpected.tdb brlock.tdb locking.tdb namelist.debug
+ if [ -d "${samba_lockdir}" ]; then
+ echo -n "Removing stale Samba tdb files: "
+ for file in brlock.tdb browse.dat connections.tdb gencache.tdb \
+ locking.tdb messages.tdb namelist.debug sessionid.tdb \
+ unexpected.tdb
do
- rm -vf "${samba_lockdir}/${file}"
+ rm "${samba_lockdir}/${file}" </dev/null 2>/dev/null && echo -n '.'
done
+ echo " done"
fi
- echo '.'
}
-# nmbd
-name=nmbd
-rcvar=`set_rcvar`
-command="%%PREFIX%%/sbin/${name}"
-required_dirs="${samba_lockdir}"
-pidfile="%%SAMBA_RUNDIR%%/${name}.pid"
-start_precmd="nmbd_precmd"
-# Defaults
-nmbd_enable=${nmbd_enable="NO"}
-nmbd_flags=${nmbd_flags="-D"}
-command_args="-s ${samba_config}"
+samba_rcvar_cmd() {
+ # Prevent recursive calling
+ unset ${rc_arg}_cmd ${rc_arg}_precmd ${rc_arg}_postcmd
+ # Check master variable
+ echo "# ${name}"
+ if [ -n "${rcvar}" ]; then
+ if checkyesno ${rcvar}; then
+ echo "\$${rcvar}=YES"
+ else
+ echo "\$${rcvar}=NO"
+ fi
+ fi
+ # Check slave variables
+ samba_cmd "${_rc_prefix}${rc_arg}" ${rc_extra_args}
+}
-load_rc_config $name
-run_rc_command "$1"
-_rc_restart_done=false
+samba_reload_cmd() {
+ local name rcvar
+ # Prevent recursive calling
+ unset ${rc_arg}_cmd ${rc_arg}_precmd ${rc_arg}_postcmd
+ # Apply to all the daemons
+ for name in ${samba_daemons}; do
+ rcvar=$(set_rcvar)
+ command="%%PREFIX%%/sbin/${name}"
+ pidfile="%%SAMBA_RUNDIR%%/${name}.pid"
+ # Daemon should be enabled and running
+ if [ -n "${rcvar}" ] && checkyesno ${rcvar}; then
+ if [ -n "$(check_pidfile "${pidfile}" "${command}")" ]; then
+ debug "reloading ${name} configuration"
+ echo "Reloading ${name}."
+ ${smbcontrol_command} "${name}" 'reload-config' ${command_args}
+ fi
+ fi
+ done
+}
-# smbd
-name=smbd
-rcvar=`set_rcvar`
-command="%%PREFIX%%/sbin/${name}"
-required_dirs="${samba_lockdir}"
-pidfile="%%SAMBA_RUNDIR%%/${name}.pid"
-start_precmd=":"
-# Defaults
-smbd_enable=${smbd_enable="NO"}
-smbd_flags=${smbd_flags="-D"}
-command_args="-s ${samba_config}"
+samba_cmd() {
+ local name rcvar
+ # Prevent recursive calling
+ unset ${rc_arg}_cmd ${rc_arg}_precmd ${rc_arg}_postcmd
+ # Stop processes in the reverse to order
+ if [ "${rc_arg}" = "stop" ] ; then
+ samba_daemons=$(reverse_list ${samba_daemons})
+ fi
+ # Apply to all the daemons
+ for name in ${samba_daemons}; do
+ rcvar=$(set_rcvar)
+ command="%%PREFIX%%/sbin/${name}"
+ pidfile="%%SAMBA_RUNDIR%%/${name}.pid"
+
+ run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
+ done
+}
-load_rc_config $name
run_rc_command "$1"
-%%WINBIND%%_rc_restart_done=false
-%%WINBIND%%
-%%WINBIND%%# winbindd
-%%WINBIND%%name=winbindd
-%%WINBIND%%rcvar=`set_rcvar`
-%%WINBIND%%command="%%PREFIX%%/sbin/${name}"
-%%WINBIND%%required_dirs="${samba_lockdir}"
-%%WINBIND%%pidfile="%%SAMBA_RUNDIR%%/${name}.pid"
-%%WINBIND%%start_precmd=":"
-%%WINBIND%%# Defaults
-%%WINBIND%%winbindd_enable=${winbindd_enable="NO"}
-%%WINBIND%%winbindd_flags=${winbindd_flags=""}
-%%WINBIND%%command_args="-s ${samba_config}"
-%%WINBIND%%
-%%WINBIND%%load_rc_config $name
-%%WINBIND%%run_rc_command "$1"