bionic still installs 'clean-shutdown' service even though no /sbin/ifdown exists

Bug #1764281 reported by John A Meinel on 2018-04-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju
High
Unassigned
2.3
High
Unassigned

Bug Description

As part of bootstrap (and maybe elsewhere), juju ends up setting this in cloud-init:
'set -xe',
"install -D -m 644 /dev/null '/etc/systemd/system/juju-clean-shutdown.service'",
"printf '%s\\n' '\n[Unit]\nDescription=Stop all network interfaces on shutdown\nDefaultDependencies=false\nAfter=final.target\n\n[Service]\nType=oneshot\nExecStart=/sbin/ifdown -a -v --force\nStandardOutput=tty\nStandardError=tty\n\n[Install]\nWantedBy=final.target\n' > '/etc/systemd/system/juju-clean-shutdown.service'", "/bin/systemctl enable '/etc/systemd/system/juju-clean-shutdown.service'"

Which means we create a systemd service that looks like:
+ install -D -m 644 /dev/null /etc/systemd/system/juju-clean-shutdown.service
+ printf %s\n
[Unit]
Description=Stop all network interfaces on shutdown
DefaultDependencies=false
After=final.target

[Service]
Type=oneshot
ExecStart=/sbin/ifdown -a -v --force
StandardOutput=tty
StandardError=tty

[Install]
WantedBy=final.target

I think this was an attempt to deal with shutdown and restart issues.

However, "/sbin/ifdown" doesn't exist on Bionic, so we certainly shouldn't be installing a service that wants to be running it.

I don't fully understand "oneshot" type services in systemd. Or exactly why this was created in the first place.

It may be that we can just omit it entirely, or it may be that we should be transitioning to some sort of netplan based "shutdown cleanly".

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers