Drop all direct usage of systemctl enable

Since we already have a wrapper script for enabling services called
os-svc-enable, drop all direct usage of systemctl enable, replacing
it with os-svc-enable.

Also drive-by replacements of == with =. == is a pattern match.

Change-Id: I707bf6f02207308e8f61caff17a27b0697096359
This commit is contained in:
Steve Kowalik 2014-08-11 16:55:33 +10:00
parent bc3d153121
commit f1d096d95a
13 changed files with 18 additions and 26 deletions

View File

@ -1,2 +1,3 @@
nova-compute
os-refresh-config
os-svc-install

View File

@ -54,13 +54,11 @@ WantedBy=multi-user.target
Alias=nova-bm-dnsmasq.service
eof
# Enable the service
systemctl enable nova-bm-dnsmasq.service
}
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
if [ "$DIB_INIT_SYSTEM" = "upstart" ]; then
install_dnsmasq_upstart
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
elif [ "$DIB_INIT_SYSTEM" = "systemd" ]; then
install_dnsmasq_systemd
fi
os-svc-enable -n nova-bm-dnsmasq

View File

@ -1 +1,2 @@
sysctl
os-svc-install

View File

@ -6,9 +6,7 @@ install-packages haproxy
[ -d /var/lib/haproxy ] || install -d -D -m 0755 -o root -g root /var/lib/haproxy
if [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
systemctl enable haproxy.service
fi
os-svc-enable -n haproxy
# haproxy service has to be explicitly enabled in /etc/default/haproxy on ubuntu/debian systems
if [ -f /etc/default/haproxy ]; then

View File

@ -0,0 +1 @@
os-svc-install

View File

@ -3,7 +3,4 @@
set -eux
install-packages keepalived
if [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
systemctl enable keepalived.service
fi
os-svc-enable -n keepalived

View File

@ -0,0 +1 @@
os-svc-install

View File

@ -3,7 +3,4 @@
set -eux
install-packages memcached
if [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
systemctl enable memcached.service
fi
os-svc-enable -n memcached

View File

@ -1,4 +1,5 @@
os-apply-config
os-refresh-config
os-svc-install
pip-manifest
source-repositories

View File

@ -63,13 +63,11 @@ Restart=on-failure
WantedBy=multi-user.target
eof
# Enable the service
systemctl enable os-collect-config.service
else
echo Only systems with systemd or upstart are supported.
exit 1
fi
os-svc-enable -n os-collect-config
set +u
deactivate

View File

@ -60,8 +60,8 @@ function enable_systemd_service() {
# TODO: SysV init fallback support
DIB_INIT_SYSTEM=$(dib-init-system)
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
if [ "$DIB_INIT_SYSTEM" = "upstart" ]; then
enable_upstart_service $SERVICENAME
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
elif [ "$DIB_INIT_SYSTEM" = "systemd" ]; then
enable_systemd_service $SERVICENAME
fi

View File

@ -1,2 +1,3 @@
pypi-mirror
os-svc-install
source-repositories

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -eux
if [ "$DIB_INIT_SYSTEM" == "upstart" ] ; then
if [ "$DIB_INIT_SYSTEM" = "upstart" ] ; then
cat > /etc/init/tripleo-cd.conf <<eof
start on runlevel [2345]
stop on runlevel [016]
@ -9,7 +9,7 @@ respawn
exec tripleo-cd.sh
eof
elif [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
elif [ "$DIB_INIT_SYSTEM" = "systemd" ] ; then
cat > /lib/systemd/system/tripleo-cd.service <<eof
[Unit]
Description=Deploy an overcloud forever.
@ -24,13 +24,11 @@ Restart=on-failure
WantedBy=multi-user.target
eof
# Enable the service
systemctl enable tripleo-cd.service
else
echo Only systems with systemd or upstart are supported.
exit 1
fi
os-svc-enable -n tripleo-cd
mkdir -p ~root/.cache/image-create
ln -s /var/cache/pypi-mirror/pypi ~root/.cache/image-create