X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=initscript.py;h=52096ebf32761bd9b7e49391ea89a8edb77e18c9;hb=8e84293a0db05b00dcb049b912397b5c3230e31e;hp=b448261da6ea9b130764c0afbea20c65bc1bc102;hpb=667b4097e91c477c867f149939f24afd3d4dfa97;p=nodemanager.git diff --git a/initscript.py b/initscript.py index b448261..52096eb 100644 --- a/initscript.py +++ b/initscript.py @@ -19,13 +19,15 @@ class Initscript: self.refresh_slice_vinit() def install_and_enable_vinit (self): + "prepare sliver rootfs init and systemd so the vinit service kicks in" # the fact that systemd attempts to run old-style services - # says we should do either or or the other and not both + # 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 do it for both systems unconditionnally - self.install_and_enable_vinit_for_init () - self.install_and_enable_vinit_for_systemd () + # 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: self.install_and_enable_vinit_for_init () # unconditionnally install and enable the generic vinit script # mimicking chkconfig for enabling the generic vinit script