[PC-BSD Commits] r19979 - in pcbsd/current/src-sh/pc-adctl: bin scripts

svn at pcbsd.org svn at pcbsd.org
Fri Oct 26 10:18:42 PDT 2012


Author: johnh
Date: 2012-10-26 17:18:42 +0000 (Fri, 26 Oct 2012)
New Revision: 19979

Added:
   pcbsd/current/src-sh/pc-adctl/scripts/pc-directory
Removed:
   pcbsd/current/src-sh/pc-adctl/scripts/pc-ad-ldap
Modified:
   pcbsd/current/src-sh/pc-adctl/bin/pc-adctl
   pcbsd/current/src-sh/pc-adctl/bin/pc-ldapctl
   pcbsd/current/src-sh/pc-adctl/scripts/Makefile
   pcbsd/current/src-sh/pc-adctl/scripts/pc-activedirectory
   pcbsd/current/src-sh/pc-adctl/scripts/pc-kerberos
   pcbsd/current/src-sh/pc-adctl/scripts/pc-kinit
   pcbsd/current/src-sh/pc-adctl/scripts/pc-ldap
   pcbsd/current/src-sh/pc-adctl/scripts/pc-nssldap
   pcbsd/current/src-sh/pc-adctl/scripts/pc-nsswitch
   pcbsd/current/src-sh/pc-adctl/scripts/pc-pam
   pcbsd/current/src-sh/pc-adctl/scripts/pc-samba
Log:
modified to be more rc friendly and work as expected.



Modified: pcbsd/current/src-sh/pc-adctl/bin/pc-adctl
===================================================================
--- pcbsd/current/src-sh/pc-adctl/bin/pc-adctl	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/bin/pc-adctl	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,10 +3,15 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-adctl
+# PROVIDE: pc_adctl
 
 . /usr/local/etc/rc.activedirectory
 
+pc_adctl_enable=${pc_activedirectory_enable-"NO"}
+
+name="pc_adctl"
+rcvar="pc_adctl_enable"
+
 adctl_cmd()
 {
 	local args="$*"
@@ -36,7 +41,7 @@
 
 adctl_start()
 {
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		adctl_cmd service pc-kerberos start
 		adctl_cmd service pc-nsswitch start
@@ -73,7 +78,7 @@
 
 adctl_stop()
 {
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		service pc-kerberos stop
 		service pc-nsswitch stop
@@ -97,7 +102,6 @@
 }
 
 
-name="pc-adctl"
 start_cmd='adctl_start'
 status_cmd='adctl_status'
 stop_cmd='adctl_stop'

Modified: pcbsd/current/src-sh/pc-adctl/bin/pc-ldapctl
===================================================================
--- pcbsd/current/src-sh/pc-adctl/bin/pc-ldapctl	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/bin/pc-ldapctl	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,10 +3,15 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-ldapctl
+# PROVIDE: pc_ldapctl
 
 . /usr/local/etc/rc.ldap
 
+pc_ldapctl_enable=${pc_ldap_enable-"NO"}
+
+name="pc_ldapctl"
+rcvar="pc_ldapctl_enable"
+
 ldapctl_assert()
 {
 	local args="$*"
@@ -21,7 +26,7 @@
 
 ldapctl_start()
 {
-	if checkyesno ldapclient_enable 2>/dev/null
+	if checkyesno pc_ldap_enable 2>/dev/null
 	then
 		ldapctl_assert service pc-nsswitch start
 		ldapctl_assert service pc-pam start
@@ -55,7 +60,7 @@
 
 ldapctl_stop()
 {
-	if checkyesno ldapclient_enable 2>/dev/null
+	if checkyesno pc_ldap_enable 2>/dev/null
 	then
 		service pc-nsswitch stop
 		service pc-pam stop
@@ -77,7 +82,6 @@
 }
 
 
-name="pc-ldapctl"
 start_cmd='ldapctl_start'
 status_cmd='ldapctl_status'
 stop_cmd='ldapctl_stop'

Modified: pcbsd/current/src-sh/pc-adctl/scripts/Makefile
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/Makefile	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/scripts/Makefile	2012-10-26 17:18:42 UTC (rev 19979)
@@ -1,5 +1,5 @@
 FILES=pc-activedirectory pc-kerberos pc-kinit pc-nsswitch pc-pam \
-	pc-samba pc-ldap pc-nssldap pc-ad-ldap
+	pc-samba pc-ldap pc-nssldap pc-directory
 
 FILESMODE=0555
 FILESDIR=/usr/local/etc/rc.d

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-activedirectory
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-activedirectory	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-activedirectory	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,22 +3,24 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-activedirectory
-# REQUIRE: pc-samba pc-kinit
+# PROVIDE: pc_activedirectory
+# REQUIRE: pc_samba pc_kinit
 # BEFORE: winbindd
 
 . /usr/local/etc/rc.activedirectory
 
+pc_activedirectory_join_enable=${pc_activedirectory_enable-"NO"}
+
+name="pc_activedirectory_join"
+rcvar="pc_activedirectory_join_enable"
+
 activedirectory_start()
 {
-	if checkyesno activedirectory_enable 2>/dev/null
-	then
-		AD_init
+	AD_init
 
-		AD_log "activedirectory_start: trying to join domain"
-		if ! AD_join_domain; then
-			return 1
-		fi
+	AD_log "activedirectory_start: trying to join domain"
+	if ! AD_join_domain; then
+		return 1
 	fi
 	
 	return 0
@@ -45,7 +47,6 @@
 }
 
 
-name="pc-activedirectory"
 start_cmd='activedirectory_start'
 status_cmd='activedirectory_status'
 stop_cmd='activedirectory_stop'

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-kerberos
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-kerberos	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-kerberos	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,11 +3,16 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-kerberos
+# PROVIDE: pc_kerberos
 # BEFORE: kerberos
 
-. /usr/local/etc/rc.activedirectory
+. /usr/local/etc/rc.active-directory
 
+pc_kerberos_enable=${pc_activedirectory_enable-"NO"}
+
+name="pc_kerberos"
+rcvar="pc_kerberos_enable"
+
 : ${PATH_KRB5_CONFIG:="/etc/krb5.conf"}
 : ${KRBCONF:="/usr/local/bin/pc-krbconf"}
 
@@ -89,32 +94,21 @@
 
 ad_krb5conf_start()
 {
-	if checkyesno activedirectory_enable 2>/dev/null
+	if AD_configured
 	then
-		if AD_configured
-		then
-			return 0
-		fi
-
-		generate_krb5_conf
-		return $?
+		return 0
 	fi
 
-	return 0
+	generate_krb5_conf
+	return $?
 }
 
 ad_krb5conf_stop()
 {
-	if checkyesno activedirectory_enable 2>/dev/null
-	then
-		cp "${PATH_KRB5_CONFIG}.orig" "${PATH_KRB5_CONFIG}"
-		return $?
-	fi
-
-	return 0
+	cp "${PATH_KRB5_CONFIG}.orig" "${PATH_KRB5_CONFIG}"
+	return $?
 }
 
-name="pc-kerberos"
 start_cmd='ad_krb5conf_start'
 stop_cmd='ad_krb5conf_stop'
         

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-kinit
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-kinit	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-kinit	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,91 +3,89 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-kinit
+# PROVIDE: pc_kinit
 # REQUIRE: kerberos
-# REQUIRE: pc-samba
+# REQUIRE: pc_samba
 # REQUIRE: ntpd
 
 . /usr/local/etc/rc.activedirectory
 
+pc_kinit_enable=${pc_activedirectory_enable-"NO"}
 
-kerberos_start()
+name="pc_kinit"
+rcvar="pc_kinit_enable"
+
+kinit_start()
 {
 	local re=1
 	local pwfile
 
-	if checkyesno activedirectory_enable 2>/dev/null
-	then
-		AD_init
+	AD_init
 
-		domainname=$(AD_get domainname)
-		adminname=$(AD_get adminname)
-		adminpw=$(AD_get adminpw)
+	local domainname=$(AD_get domainname)
+	local adminname=$(AD_get adminname)
+	local adminpw=$(AD_get adminpw)
 
-		if [ -n "${adminname}" -a -n "${domainname}" -a -n "${adminpw}" ]
-		then
-			domainname=$(echo "${domainname}" | tr a-z A-Z)
+	if [ -n "${adminname}" -a -n "${domainname}" -a -n "${adminpw}" ]
+	then
+		domainname=$(echo "${domainname}" | tr a-z A-Z)
 
-			pwfile=$(mktemp /tmp/tmp.XXXXXXXX)
-			printf "${adminpw}" > ${pwfile}
+		pwfile=$(mktemp /tmp/tmp.XXXXXXXX)
+		printf "${adminpw}" > ${pwfile}
 
-			AD_log "kerberos_start: kinit --password-file=${pwfile} " \
-			    "${adminname}@${domainname}"
-			kinit --password-file="${pwfile}" \
-			    "${adminname}@${domainname}"
-			res=$?
+		AD_log "kinit_start: kinit --password-file=${pwfile} " \
+		    "${adminname}@${domainname}"
+		kinit --password-file="${pwfile}" \
+		    "${adminname}@${domainname}"
+		res=$?
 
-			local ok="Failed"
-			if [ "${res}" = "0" ]
-			then
-				ok="Successful"
-			fi
+		local ok="Failed"
+		if [ "${res}" = "0" ]
+		then
+			ok="Successful"
+		fi
 
-			AD_log "kerberos_start: ${ok}"
-			rm -f "${pwfile}"
-			sleep 10
-		fi
+		AD_log "kinit_start: ${ok}"
+		rm -f "${pwfile}"
+		sleep 10
 	fi
 
 	return ${res}
 }
 
-kerberos_status()
+kinit_status()
 {
 	local res=1
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	AD_init
+
+	local domainname=$(AD_get domainname)
+	local adminname=$(AD_get adminname)
+	local adminpw=$(AD_get adminpw)
+
+	if [ -n "${adminname}" -a -n "${domainname}" -a -n "${adminpw}" ]
 	then
-		AD_init
+		domainname=$(echo "${domainname}"|tr a-z A-Z)
 
-		domainname=$(AD_get domainname)
-		adminname=$(AD_get adminname)
-		adminpw=$(AD_get adminpw)
+		AD_log "kinit_status: klist -l | grep -q ^${adminname}@${domainname}"
+		klist -l | grep -q "^${adminname}@${domainname}"
+		res=$?
 
-		if [ -n "${adminname}" -a -n "${domainname}" -a -n "${adminpw}" ]
+		local ok="Failed"
+		if [ "${res}" = "0" ]
 		then
-			domainname=$(echo "${domainname}"|tr a-z A-Z)
+			ok="Successful"
+		fi
 
-			AD_log "kerberos_status: klist -l | grep -q ^${adminname}@${domainname}"
-			klist -l | grep -q "^${adminname}@${domainname}"
-			res=$?
-
-			local ok="Failed"
-			if [ "${res}" = "0" ]
-			then
-				ok="Successful"
-			fi
-
-			AD_log "kerberos_status: ${ok}"
-		fi
+		AD_log "kinit_status: ${ok}"
 	fi
 
 	return ${res}
 }
 
-kerberos_stop()
+kinit_stop()
 {
-	AD_log "kerberos_stop: kdestroy"
+	AD_log "kinit_stop: kdestroy"
 
 	kdestroy
 	local ok="Failed"
@@ -96,14 +94,13 @@
 		ok="Successful"
 	fi
 
-	AD_log "kerberos_stop: ${ok}"
+	AD_log "kinit_stop: ${ok}"
 	return 0
 }
 
-name="pc-kinit"
-start_cmd='kerberos_start'
-status_cmd='kerberos_status'
-stop_cmd='kerberos_stop'
+start_cmd='kinit_start'
+status_cmd='kinit_status'
+stop_cmd='kinit_stop'
 
 load_rc_config $name
 run_rc_command "$1"

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-ldap
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-ldap	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-ldap	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,11 +3,16 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-ldap
+# PROVIDE: pc_ldapconf
 # REQUIRE: root
 # BEFORE: NETWORK
 
 . /usr/local/etc/rc.ldap
+
+pc_ldapconf_enable=${pc_ldap_enable-"NO"}
+
+name="pc_ldapconf"
+rcvar="pc_ldapconf_enable"
     
 : ${OPENLDAP_CONF:="/usr/local/etc/openldap/ldap.conf"}
 : ${LDAPCONF:="/usr/local/bin/pc-ldapconf"}
@@ -126,7 +131,7 @@
 	return 0
 }
 
-ldap_status()
+ldapconf_status()
 {
 	local ret=0
 	local res=1
@@ -187,40 +192,30 @@
 	return ${ret}
 }
 
-ldap_start()
+ldapconf_start()
 {
-	if checkyesno ldapclient_enable 2>/dev/null
+	ldap_init
+	if ldap_configured
 	then
-		ldap_init
-		if ldap_configured
-		then
-			return 0
-		fi
-
-		backup_openldap_conf
-		generate_openldap_conf
-		return $?
+		return 0
 	fi
 
-	return 0
+	backup_openldap_conf
+	generate_openldap_conf
+	return $?
 }
 
-ldap_stop()
+ldapconf_stop()
 {
-	if  checkyesno ldapclient_enable 2>/dev/null
-	then
-		restore_openldap_conf
-		return $?
-	fi
+	restore_openldap_conf
+	return $?
 
-	return 0
 }
 
 
-name="pc-ldap"
-start_cmd='ldap_start'
-status_cmd='ldap_status'
-stop_cmd='ldap_stop'
+start_cmd='ldapconf_start'
+status_cmd='ldapconf_status'
+stop_cmd='ldapconf_stop'
             
 load_rc_config $name
 run_rc_command "$1"

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-nssldap
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-nssldap	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-nssldap	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,12 +3,26 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-nssldap
+# PROVIDE: pc_nssldapconf
 # REQUIRE: root
 # BEFORE: NETWORK
 
 . /usr/local/etc/rc.ldap
 . /usr/local/etc/rc.activedirectory
+
+: ${pc_nssldapconf_enable:="NO"}
+
+if [ "${pc_ldap_enable}" = "YES" ]
+then
+	pc_nssldapconf_enable="YES"
+
+elif [ "${pc_activedirectory_enable}" = "YES" ]
+then
+	pc_nssldapconf_enable="YES"
+fi
+
+name="pc_nssldapconf"
+rcvar="pc_nssldapconf_enable"
     
 : ${NSS_LDAP_CONF:="/usr/local/etc/nss_ldap.conf"}
 : ${NSS_LDAP_SECRET:="/usr/local/etc/nss_ldap.secret"}
@@ -327,9 +341,9 @@
 	return 0
 }
 
-nssldap_start()
+nssldapconf_start()
 {
-	if checkyesno ldapclient_enable 2>/dev/null
+	if checkyesno pc_ldap_enable 2>/dev/null
 	then
 		ldap_init
 		if ldap_configured
@@ -341,7 +355,7 @@
 		generate_LDAP_nss_ldap_conf
 		return $?
 
-	elif checkyesno activedirectory_enable 2>/dev/null
+	elif checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		AD_init
 		if AD_configured
@@ -357,14 +371,14 @@
 	return 0
 }
 
-nssldap_stop()
+nssldapconf_stop()
 {
-	if  checkyesno ldapclient_enable 2>/dev/null
+	if  checkyesno pc_ldap_enable 2>/dev/null
 	then
 		restore_nss_ldap_conf
 		return $?
 
-	elif checkyesno activedirectory_enable 2>/dev/null
+	elif checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		restore_nss_ldap_conf
 		return $?
@@ -373,10 +387,9 @@
 	return 0
 }
 
-name="pc-nssldap"
-start_cmd='nssldap_start'
+start_cmd='nssldapconf_start'
 status_cmd=':'
-stop_cmd='nssldap_stop'
+stop_cmd='nssldapconf_stop'
             
 load_rc_config $name
 run_rc_command "$1"

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-nsswitch
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-nsswitch	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-nsswitch	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,13 +3,27 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-nsswitch
+# PROVIDE: pc_nsswitch
 # REQUIRE: root
 # BEFORE: nsswitch
 
 . /usr/local/etc/rc.ldap
 . /usr/local/etc/rc.activedirectory
 
+: ${pc_nsswitch_enable:="NO"}
+
+if [ "${pc_ldap_enable}" = "YES" ]
+then
+	pc_nsswitch_enable="YES"
+
+elif [ "${pc_activedirectory_enable}" = "YES" ]
+then
+	pc_nsswitch_enable="YES"
+fi
+
+name="pc_nsswitch"
+rcvar="pc_nsswitch_enable"
+
 : ${PATH_NS_CONF:="/etc/nsswitch.conf"}
 : ${NSSCONF:="/usr/local/bin/pc-nssconf"}
 
@@ -19,7 +33,7 @@
 	local conftype
 	local cmd="${NSSCONF}"
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		conftype='winbind'
 		doconf=1
@@ -30,7 +44,7 @@
 			return 0
 		fi
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		conftype='ldap'
 		doconf=1
@@ -78,14 +92,14 @@
 	local conftype
 	local cmd="${NSSCONF}"
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		conftype='winbind'
 		doconf=1
 
 		AD_init
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		conftype='ldap'
 		doconf=1
@@ -123,7 +137,6 @@
 }
 
 
-name="pc-nsswitch"
 start_cmd='nsswitch_conf_start'
 stop_cmd='nsswitch_conf_stop'
         

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-pam
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-pam	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-pam	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,14 +3,28 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-pam
+# PROVIDE: pc_pam
 # REQUIRE: root
-# REQUIRE: pc-nsswitch
+# REQUIRE: pc_nsswitch
 # BEFORE: NETWORK
 
 . /usr/local/etc/rc.ldap
 . /usr/local/etc/rc.activedirectory
 
+: ${pc_pam_enable:="NO"}
+
+if [ "${pc_ldap_enable}" = "YES" ]
+then
+	pc_pam_enable="YES"
+
+elif [ "${pc_activedirectory_enable}" = "YES" ]
+then
+	pc_pam_enable="YES"
+fi
+
+name="pc_pam"
+rcvar="pc_pam_enable"
+
 : ${DEFAULT_PAM_SERVICES:="gdm-autologin kde kde-np login sshd su xdm gdm sudo xscreensaver"}
 
 : ${PAMDIRS:="/etc/pam.d /usr/local/etc/pam.d"}
@@ -106,11 +120,11 @@
 	local tmp="$(echo ${name}|tr '.-' _)"
 	local var=""
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		var="\$$(printf "activedirectory_pam_${tmp}")"
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		var="\$$(printf "ldapclient_pam_${tmp}")"
 
@@ -135,7 +149,7 @@
 	local var
 	local val
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		local tmp="$(echo ${service}|tr '.-' _)"
 
@@ -147,7 +161,7 @@
 			return 0
 		fi
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		local tmp="$(echo ${service}|tr '.-' _)"
 
@@ -176,7 +190,7 @@
 		return 1
 	fi
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		local tmp="$(echo ${service}|tr '.-' _)"
 
@@ -190,7 +204,7 @@
 
 		check=1
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		local tmp="$(echo ${service}|tr '.-' _)"
 
@@ -569,11 +583,11 @@
 	local tmpdirs=""
 	local pam_dir
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		services="${activedirectory_pam_services}"
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		services="${ldapclient_pam_services}"
 	fi
@@ -762,7 +776,7 @@
 	local session
 	local password
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		auth="+auth:sufficient:${pam_winbind}:silent:try_first_pass:krb5_auth:krb5_ccache_type=FILE"
 		account="+account:sufficient:${pam_winbind}:krb5_auth:krb5_ccache_type=FILE"
@@ -772,7 +786,7 @@
 		do_pam_conf "${auth}" "${account}" "${session}" "${password}"
 		return $?
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		auth="+auth:sufficient:${pam_ldap}:silent:no_warn:try_first_pass"
 		account="+account:sufficient:${pam_ldap}:ignore_authinfo_unavail"
@@ -794,7 +808,7 @@
 	local password
 	local doconf=0
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		auth="-auth:sufficient:${pam_winbind}"
 		account="-account:sufficient:${pam_winbind}"
@@ -804,7 +818,7 @@
 		do_pam_conf "${auth}" "${account}" "${session}" "${password}"
 		return $?
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		auth='-auth:sufficient:${pam_ldap}'
 		account='-account:sufficient:${pam_ldap}'
@@ -819,7 +833,6 @@
 }
 
 
-name="pc-pam"
 start_cmd='pam_start'
 stop_cmd='pam_stop'
         

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-samba
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-samba	2012-10-26 16:21:02 UTC (rev 19978)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-samba	2012-10-26 17:18:42 UTC (rev 19979)
@@ -3,14 +3,28 @@
 # $FreeBSD$
 #
 
-# PROVIDE: pc-samba
+# PROVIDE: pc_samba
 # REQUIRE: FILESYSTEMS mountlate
-# REQUIRE: pc-pam
+# REQUIRE: pc_pam
 # BEFORE: smbd
 
 . /usr/local/etc/rc.ldap
 . /usr/local/etc/rc.activedirectory
 
+: ${pc_samba_enable:="NO"}
+
+if [ "${pc_ldap_enable}" = "YES" ]
+then
+	pc_samba_enable="YES"
+
+elif [ "${pc_activedirectory_enable}" = "YES" ]
+then
+	pc_samba_enable="YES"
+fi
+
+name="pc_samba"
+rcvar="pc_samba_enable"
+
 : ${SMB_CONF:="/usr/local/etc/smb.conf"}
 : ${SAMBACONF:="/usr/local/bin/pc-sambaconf"}
 
@@ -23,7 +37,7 @@
 		cmd="${SAMBACONF} -f ${SMB_CONF}"
 	fi
 
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		local tmp=$(mktemp /tmp/samba.XXXXXX)
 		local cmdstr
@@ -107,7 +121,7 @@
 		cmd="${SAMBACONF} -f ${SMB_CONF}"
 	fi
 
-	if checkyesno ldapclient_enable 2>/dev/null
+	if checkyesno pc_ldap_enable 2>/dev/null
 	then
 		local tmp=$(mktemp /tmp/samba.XXXXXX)
 
@@ -169,7 +183,7 @@
 
 smbconf_start()
 {
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		AD_init
 		if AD_configured
@@ -180,7 +194,7 @@
 		ad_smbconf_start
 		return $?
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		ldap_init
 		if ldap_configured
@@ -197,12 +211,12 @@
 
 smbconf_stop()
 {
-	if checkyesno activedirectory_enable 2>/dev/null
+	if checkyesno pc_activedirectory_enable 2>/dev/null
 	then
 		cp "${SMB_CONF}.orig" "${SMB_CONF}"
 		return $?
 
-	elif checkyesno ldapclient_enable 2>/dev/null
+	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
 		cp "${SMB_CONF}.orig" "${SMB_CONF}"
 		return $?
@@ -211,7 +225,6 @@
 	return 0
 }
 
-name="pc-samba"
 start_cmd='smbconf_start'
 stop_cmd='smbconf_stop'
 



More information about the Commits mailing list