[node-devel] Introduction and migration of the ovirt-node SysV init scripts to systemd

Mike Burns mburns at redhat.com
Wed Feb 15 20:44:45 UTC 2012


On Wed, 2012-02-15 at 21:27 +0100, Fabian Deutsch wrote:
> Hey,
> 
> I'm new to this list a just want to quickly introduce myself. My name is
> Fabian Deutsch (fabiand), I'm 29yrs of age and live near Bremen in
> Germany. Currently I'm maintaining a couple of packages and using
> libvirt and friends within our working group to maintain a couple of
> virtual guests.
> 
> Coming to ovirt-node I saw that the init scripts are in the SysV/LSB
> format, but it makes sense to migrate them - like the init scripts of
> all daemons - to systemd.
> Because the scripts ain't trivial I would like to discuss the migration
> before.
> 
> First it seems if the affected files are ovirt and ovirt-awake,
> ovirt-early, and ovirt-firstboot in the scripts directory.
> Besides fulfilling the SysV requirements by providing start(), stop()
> etc. those files also contain much logic to setup and check ovirt
> specific things.
> But it's essential to pull the logic out of the init scripts, to allow a
> migration to systemd service files, which usually just call an
> appropriate daemon or - like in our case - oneshot scripts.
> 
> Therefor I'm suggesting to split the SysV stuff from the logic in a
> first step while keeping SysV init files.
> After this step we would have reduced SysV init scripts, containing just
> the relevant SysV stuff and a bunch of scripts residing in
> e.g. /usr/libexec/ovirt which provide the logic and are used by the init
> scripts to do the magic.
> 
> The second step would then be to replace the reduced init scripts by
> appropriate systemd service files.
> 
> A last step could be migrating the init scripts to python, in order to
> consolidate some code.

Definitely important.  We currently have a number of functions in
ovirt-functions (bash) and ovirtfunctions.py (python) that do the same
thing.  Since the vast majority of the scripts are in python now,
getting the init scripts to be python would allow us to deprecate the
ovirt-functions script.  

> 
> One problem I could imagine is, that the scripts currently export some
> global variables and I don't to whom they will visible when using
> systemd files - or if there is no change in the behavior at all.

I don't know of anywhere that we rely on the global variables.  In
truth, any variables should be set in the /etc/default/ovirt file
directly and sourced from there in other scripts.  

> 
> Does the migration and the suggested steps make sense? 
> Or am I missing something?

The migration makes sense to me.  One thing to keep in mind on this is
the fact that we have to continue to support RHEL which hasn't moved to
systemd yet.  So having both the systemd and sysv init scripts around
and running the same code in the background is also an important step.  

Mike

> 
> Greetings
> fabian
> 
> _______________________________________________
> node-devel mailing list
> node-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/node-devel





More information about the node-devel mailing list