X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=initscript.py;h=0876abbe9a5f54976b04b9644e3e638e22dccf1d;hb=ecee05390277f57b02d21ffca0195292bde1defa;hp=7a270daaeeb8d5f837142a2d3e811e0b53628ab8;hpb=4a64676042177ee6c9435a9c60ba3db90e3c17d0;p=nodemanager.git diff --git a/initscript.py b/initscript.py index 7a270da..0876abb 100644 --- a/initscript.py +++ b/initscript.py @@ -24,13 +24,10 @@ class Initscript: # says we should do either one or the other and not both # but actually if that was true we could just do it for init and be fine # which is not what we've seen starting with f18 - # so for now let's try to do it for both systems unconditionnally - # - # this being said all the paths do not necessarily exist on all flavours of rootfs - try: self.install_and_enable_vinit_for_init () - except: pass + # so we try for a systemd system, and if it fails it means + # one of the dir does not exist and so we are dealing with an init-based rootfs try: self.install_and_enable_vinit_for_systemd () - except: pass + except: self.install_and_enable_vinit_for_init () # unconditionnally install and enable the generic vinit script # mimicking chkconfig for enabling the generic vinit script @@ -51,7 +48,7 @@ class Initscript: logger.log("Initscript: %s: creating runlevel3 symlink %s"%(self.name,enable_link)) os.symlink(enable_target,enable_link) except: - logger.log_exc("Initscript: %s: failed to create runlevel3 symlink %s"%enable_link) + logger.log_exc("Initscript failed to create runlevel3 symlink %s"%enable_link,name=self.name) # very similar but with systemd unit files - we target 'multi-user' in this context def install_and_enable_vinit_for_systemd(self): @@ -70,7 +67,7 @@ class Initscript: logger.log("Initscript: %s: creating enabling symlink %s"%(self.name,enable_link)) os.symlink(enable_target,enable_link) except: - logger.log_exc("Initscript: %s: failed to create enabling symlink %s"%enable_link) + logger.log_exc("Initscript failed to create enabling symlink %s"%enable_link,name=name) #ln -s '/usr/lib/systemd/system/vinit.service' '/etc/systemd/system/multi-user.target.wants/vinit.service'