- Sliver_Libvirt.start (self, delay)
- # if a change has occured in the slice initscript, reflect this in /etc/init.d/vinit.slice
- self.refresh_slice_vinit()
-
- def rerun_slice_vinit (self):
- """This is called whenever the initscript code changes"""
- # xxx - todo - not sure exactly how to:
- # (.) invoke something in the guest
- # (.) which options of systemctl should be used to trigger a restart
- # should not prevent the first run from going fine hopefully
- logger.log("WARNING: sliver_lxc.rerun_slice_vinit not implemented yet")
+# logger.log("NM is exiting for debug - just about to start {}".format(self.name))
+# exit(0)
+ Sliver_Libvirt.start(self, delay)
+
+ def rerun_slice_vinit(self):
+ """This is called at startup, and whenever the initscript code changes"""
+ logger.log("sliver_lxc.rerun_slice_vinit {}".format(self.name))
+ plain = "virsh -c lxc:/// lxc-enter-namespace --noseclabel -- {} /usr/bin/systemctl --system daemon-reload"\
+ .format(self.name)
+ command = plain.split()
+ logger.log_call(command, timeout=3)
+ plain = "virsh -c lxc:/// lxc-enter-namespace --noseclabel -- {} /usr/bin/systemctl restart vinit.service"\
+ .format(self.name)
+ command = plain.split()
+ logger.log_call(command, timeout=3)
+