Blame SOURCES/authconfig-6.2.8-services.patch

bf4f0e
diff -up authconfig-6.2.8/authconfig-gtk.py.services authconfig-6.2.8/authconfig-gtk.py
bf4f0e
--- authconfig-6.2.8/authconfig-gtk.py.services	2014-09-29 15:37:19.000000000 +0200
bf4f0e
+++ authconfig-6.2.8/authconfig-gtk.py	2014-09-29 15:41:20.478788789 +0200
bf4f0e
@@ -257,7 +257,7 @@ class Authconfig:
bf4f0e
 				self.info = backup
bf4f0e
 			# Save.
bf4f0e
 			if (response == 1):
bf4f0e
-				self.apply()
bf4f0e
+				self.apply(nostart=True)
bf4f0e
 				backup = self.info
bf4f0e
 		return backup
bf4f0e
 
bf4f0e
@@ -266,7 +266,10 @@ class Authconfig:
bf4f0e
 		if not backup:
bf4f0e
 			return
bf4f0e
 		self.winbindjoin_launch(button, map, xml, parent)
bf4f0e
-		self.info = backup
bf4f0e
+		if self.info != backup:
bf4f0e
+			self.info = backup
bf4f0e
+		else:
bf4f0e
+			self.apply()
bf4f0e
 
bf4f0e
 	def winbindjoin_launch(self, button, map, xml, parent):
bf4f0e
 		if not self.info.joinUser:
bf4f0e
@@ -285,7 +288,10 @@ class Authconfig:
bf4f0e
 		if not backup:
bf4f0e
 			return
bf4f0e
 		self.ipav2join_launch(button, map, xml, parent)
bf4f0e
-		self.info = backup
bf4f0e
+		if self.info != backup:
bf4f0e
+			self.info = backup
bf4f0e
+		else:
bf4f0e
+			self.apply()
bf4f0e
 
bf4f0e
 	def ipav2join_launch(self, button, map, xml, parent):
bf4f0e
 		response = self.run_on_button(None, "joinipadomain",
bf4f0e
@@ -772,7 +778,7 @@ class Authconfig:
bf4f0e
 		return dialog
bf4f0e
 
bf4f0e
 	# Save changes.
bf4f0e
-	def apply(self):
bf4f0e
+	def apply(self, nostart = False):
bf4f0e
 		self.update_type(self.id_map, self.currid)
bf4f0e
 		self.update_type(self.auth_map, self.currauth)
bf4f0e
 		self.apply_idsettings()
bf4f0e
@@ -788,7 +794,7 @@ class Authconfig:
bf4f0e
 		else:
bf4f0e
 			self.info.writeChanged(self.pristineinfo)
bf4f0e
 
bf4f0e
-		self.info.post(False)
bf4f0e
+		self.info.post(nostart)
bf4f0e
 		if "--firstboot" in sys.argv:
bf4f0e
 			for service in firstbootservices:
bf4f0e
 				if authinfo.Service.isEnabled(service):
bf4f0e
diff -up authconfig-6.2.8/authinfo.py.services authconfig-6.2.8/authinfo.py
bf4f0e
--- authconfig-6.2.8/authinfo.py.services	2014-09-29 15:43:38.000000000 +0200
bf4f0e
+++ authconfig-6.2.8/authinfo.py	2014-09-29 15:44:28.629036362 +0200
bf4f0e
@@ -4395,15 +4395,15 @@ class AuthInfo:
bf4f0e
 			"winbind", nostart)
bf4f0e
 
bf4f0e
 	def toggleSSSDService(self, nostart):
bf4f0e
-		
bf4f0e
 		explicitenable = ((self.enableSSSD and self.enableSSSDAuth) or
bf4f0e
 			(self.enableSSSD and os.path.exists(PATH_SSSD_CONFIG)) or
bf4f0e
 			(self.enableSSSDAuth and os.path.exists(PATH_SSSD_CONFIG)))
bf4f0e
-		toggleSplatbindService(self.implicitSSSD or self.implicitSSSDAuth or
bf4f0e
-			self.enableIPAv2 or explicitenable,
bf4f0e
+		enable = (self.implicitSSSD or self.implicitSSSDAuth or
bf4f0e
+			self.enableIPAv2 or explicitenable)
bf4f0e
+		toggleSplatbindService(enable,
bf4f0e
 			PATH_SSSD,
bf4f0e
-			"sssd", nostart or not (self.implicitSSSD or self.implicitSSSDAuth
bf4f0e
-			or self.enableIPAv2))
bf4f0e
+			"sssd", nostart or (enable and not (self.implicitSSSD or
bf4f0e
+			self.implicitSSSDAuth or self.enableIPAv2)))
bf4f0e
 
bf4f0e
 	def toggleOddjobService(self, nostart):
bf4f0e
 		if self.enableMkHomeDir and os.access("%s/pam_%s.so"
bf4f0e
diff -up authconfig-6.2.8/man/en/authconfig.8.services authconfig-6.2.8/man/en/authconfig.8
bf4f0e
--- authconfig-6.2.8/man/en/authconfig.8.services	2013-11-01 16:08:01.000000000 +0100
bf4f0e
+++ authconfig-6.2.8/man/en/authconfig.8	2014-09-29 15:40:31.872691485 +0200
bf4f0e
@@ -35,7 +35,7 @@ be restored by the \fB--restorelastbacku
bf4f0e
 
bf4f0e
 If \fB--nostart\fR is specified (which is what the install program does),
bf4f0e
 ypbind or other daemons will not be started or stopped immediately following
bf4f0e
-program execution, but only enabled to start or stop at boot time. 
bf4f0e
+program execution, but only enabled to start or stop at boot time.
bf4f0e
 
bf4f0e
 The \fB--enablenis\fP, \fB--enableldap\fP, \fB--enablewinbind\fP,
bf4f0e
 and \fB--enablehesiod\fP options
bf4f0e
@@ -94,6 +94,22 @@ The \fB/usr/bin/authconfig\fR uses the \
bf4f0e
 system user before it starts up. If you want to run it directly without the 
bf4f0e
 authentication as the system user, run the \fB/usr/sbin/authconfig\fR command.
bf4f0e
 
bf4f0e
+The SSSD service is enabled and possibly started by authconfig when at least two of
bf4f0e
+the following three conditions are met:
bf4f0e
+.br
bf4f0e
+1) /etc/sssd/sssd.conf file exists (or is configured via the implicit SSSD support)
bf4f0e
+.br
bf4f0e
+2) SSSD authentication is enabled (pam_sss.so is used in PAM configuration)
bf4f0e
+.br
bf4f0e
+3) SSSD is enabled for user identity (nsswitch.conf contains sss)
bf4f0e
+
bf4f0e
+When \fB--update\fR action is used the enablement or disablement and possible restart
bf4f0e
+of services happens only in case the changed configuration options affect the
bf4f0e
+service to be restarted. This means that if for example the ypbind service is
bf4f0e
+enabled with \fBauthconfig --update --nostart --enablenis\fR but not started
bf4f0e
+and you run the same command without the \fB--nostart\fR later the ypbind
bf4f0e
+service will not be started because no configuration change affecting ypbind
bf4f0e
+happened.
bf4f0e
 .PD
bf4f0e
 .SH "RETURN CODES"
bf4f0e
 \fBauthconfig\fR returns 0 on success, 1 on backup operation errors,