Blame SOURCES/authconfig-6.2.8-services.patch

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