[ironic-agent] Use svc-map for enabling agent
Switch to using svc-map element for systemd based agent. This allows both .deb and .rpm installs to share the element for systemd based installs. There are not any plans to package a .rpm package for upstart or sysv, so these are left as is. Change-Id: Idca7ad97355cae785162989774a7e6dea6fdc5b5 Closes-Bug: #1490584
This commit is contained in:
parent
12d71c6447
commit
109e02b1ce
@ -16,5 +16,10 @@ Beyond installing the ironic-python-agent, this element does the following:
|
||||
in order to support source based installation of ironic-python-agent and its
|
||||
dependencies.
|
||||
|
||||
.. note::
|
||||
The package based install currently only enables the service when using the
|
||||
systemd init system. This can easily be changed if there is an agent
|
||||
package which includes upstart or sysv packaging.
|
||||
|
||||
.. note::
|
||||
Using the ramdisk will require at least 1.5GB of ram
|
||||
|
@ -1,2 +1,5 @@
|
||||
dhcp-all-interfaces
|
||||
package-installs
|
||||
pkg-map
|
||||
source-repositories
|
||||
svc-map
|
||||
|
@ -28,8 +28,7 @@ case "$DIB_INIT_SYSTEM" in
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.conf /etc/init/ironic-python-agent.conf
|
||||
;;
|
||||
systemd)
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/ironic-python-agent.service
|
||||
systemctl enable ironic-python-agent.service
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/$(svc-map ironic-python-agent).service
|
||||
;;
|
||||
sysv)
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.init /etc/init.d/ironic-python-agent.init
|
||||
|
@ -14,7 +14,7 @@ umask 022
|
||||
expect stop
|
||||
|
||||
pre-start script
|
||||
echo Starting Ironic Python Agnet
|
||||
echo Starting Ironic Python Agent
|
||||
end script
|
||||
|
||||
exec /usr/bin/ironic-python-agent
|
||||
|
@ -17,11 +17,10 @@ case "$DIB_INIT_SYSTEM" in
|
||||
;;
|
||||
systemd)
|
||||
systemctl disable iptables.service
|
||||
systemctl enable openstack-ironic-python-agent.service
|
||||
systemctl enable $(svc-map ironic-python-agent).service
|
||||
;;
|
||||
sysv)
|
||||
update-rc.d iptables disable
|
||||
update-rc.d openstack-ironic-python-agent enable
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported init system"
|
||||
|
4
elements/ironic-agent/svc-map
Normal file
4
elements/ironic-agent/svc-map
Normal file
@ -0,0 +1,4 @@
|
||||
ironic-python-agent:
|
||||
default: openstack-ironic-python-agent
|
||||
redhat: openstack-ironic-python-agent
|
||||
debian: ironic-python-agent
|
Loading…
Reference in New Issue
Block a user