diff -Nur smeserver-yum-2.6.0.old/root/usr/lib/yum-plugins/smeserver.py smeserver-yum-2.6.0/root/usr/lib/yum-plugins/smeserver.py --- smeserver-yum-2.6.0.old/root/usr/lib/yum-plugins/smeserver.py 2020-11-15 01:12:19.273000000 -0500 +++ smeserver-yum-2.6.0/root/usr/lib/yum-plugins/smeserver.py 2020-11-15 01:14:00.376000000 -0500 @@ -20,6 +20,8 @@ eventlist = dict() actionlist = dict() +actionlistpre = dict() +actionlistpost = dict() templateslist = dict() serviceslist = dict() @@ -100,6 +102,8 @@ global smechange global eventlist global actionlist + global actionlistpre + global actionlistpost global templateslist global serviceslist global erasing @@ -161,6 +165,8 @@ global smechange global eventlist global actionlist + global actionlistpre + global actionlistpost global templateslist global serviceslist global erasing @@ -225,8 +231,15 @@ mytmpaction = os.path.realpath(os.readlink(tmppath + f).replace("..",events_path)) #print "link " + f + ": " + mytmpaction - if not actionlist.has_key(mytmpaction): - actionlist[mytmpaction] = mytmpaction + if f < "S05generic_template_expand": + if not actionlistpre.has_key(mytmpaction): + actionlistpre[mytmpaction] = mytmpaction + elif f > "S90adjust-services": + if not actionlistpost.has_key(mytmpaction): + actionlistpost[mytmpaction] = mytmpaction + else: + if not actionlist.has_key(mytmpaction): + actionlist[mytmpaction] = mytmpaction if os.path.isdir(tmppath + "templates2expand" + os.sep): tmppathtmpl = tmppath + "templates2expand" + os.sep @@ -277,9 +290,9 @@ # now, if smechange is false (no reboot needed), we can execute actions, expan templates and adjust services #if not smechange: - if len(actionlist)>0: - print "Executing actions" - for kactions in actionlist: + if len(actionlistpre)>0: + print "Executing early actions" + for kactions in actionlistpre: #print kactions if os.path.isfile(kactions): os.spawnl(os.P_WAIT, kactions, kactions) @@ -293,12 +306,25 @@ if os.path.exists(mytemplatedir) or os.path.exists(mytemplatemeta): os.spawnl(os.P_WAIT, expand_template, expand_template, ktemplates) + if len(actionlist)>0: + print "Executing actions" + for kactions in actionlist: + #print kactions + if os.path.isfile(kactions): + os.spawnl(os.P_WAIT, kactions, kactions,"post-upgrade") + if len(serviceslist)>0: print "Adjusting services" for kservices in serviceslist: print kservices + ": " + serviceslist[kservices] os.spawnl(os.P_WAIT, service, service, kservices, serviceslist[kservices]) + if len(actionlistpost)>0: + print "Executing late actions" + for kactions in actionlistpost: + #print kactions + if os.path.isfile(kactions): + os.spawnl(os.P_WAIT, kactions, kactions) if smechange: os.spawnl(os.P_WAIT, config_set, config_set, 'set', 'UnsavedChanges', 'yes')