87236af75c
When a glean is running on centos with multiple NICs, it will try to systemctl enable network.service multiple times for each interface. Because of systemd magic, it is possible for the systemctl command to fail in a race condition. glean shouldn't be enabling network.service during boot in pre-networking phases (Ib2b618dd975ca44e9c6b0a2c9027642ffc46b9b0). I have proposed I8319f1ed6498a9d447950c2b4b34bca59e7b97e4 to remove this and document the behaviour. This also bring across suse's version (I20bffabd333ea290d8712ec2a467f2b2d5678f3a) Change-Id: I89d9443cb61e287bd0d9da3f48315272218ee335 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
37 lines
894 B
Bash
Executable file
37 lines
894 B
Bash
Executable file
#!/bin/bash
|
|
|
|
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
case "$DIB_INIT_SYSTEM" in
|
|
upstart)
|
|
# nothing to do
|
|
exit 0
|
|
;;
|
|
systemd)
|
|
if [[ ${DISTRO_NAME} =~ (centos|rhel7|fedora) ]]; then
|
|
# NOTE(pabelanger): Glean requires network.service for
|
|
# these platforms.
|
|
systemctl enable network.service
|
|
elif [[ ${DISTRO_NAME} =~ (opensuse) ]]; then
|
|
# on suse, this is named wicked.service, but it's the same
|
|
# as network.service.
|
|
systemctl enable wicked.service
|
|
fi
|
|
;;
|
|
openrc)
|
|
# let dib-init-system's postinstall handle enabling init scripts
|
|
exit 0
|
|
;;
|
|
sysv)
|
|
# nothing to do
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "Unsupported init system $DIB_INIT_SYSTEM"
|
|
exit 1
|
|
;;
|
|
esac
|