Grouping service units for bulk stop/start ?
Daniel P. Berrange
berrange at redhat.com
Mon Jun 25 14:27:39 UTC 2012
With OpenStack there are quite a large number of daemons per host, each
of which has their own .service unit file.
Currently our OpenStack instructions have such fun commands as:
# for svc in api registry; do sudo systemctl start openstack-glance-$svc.service; done
# for svc in api objectstore compute network volume scheduler cert; do sudo systemctl start openstack-nova-$svc.service; done
What I'd like to be able todo is setup some kind of grouping, so that
you can just start/stop/check status of everything in simple commands
# sudo systemctl start openstack-nova.target
# sudo systemctl status openstack-nova.target
# sudo systemctl stop openstack-nova.target
My naive attempt to make this work was todo
- Create a openstack-nova.target containining
- Edit each of openstack-nova-XXX.service to change
WantedBy=multi-user.target to WantedBy=openstack-nova.target
But after doing this, stopping/starting the target has no effect on the
running state of units I associated with it. Also I'd like starting/stopping
XXX.target to take account of the enablement state of the individual
XXX-YYY.service files. eg so I can disable say, openstack-nova-network.service
on a host, but still use openstack-nova.target to bulk stop/start all the
other services that are enabled.
Either I'm missing some config change, or what I'm attempting is just not
the kind of functionality that .target files are intended to offer ?
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the devel