Skip to content

pkgos-gen-systemd-unit: emit Wants= for other Required-Start: services

Just the After= (ordering) property is not sufficient to guarantee the listed units 'must be available to start the script' [0] as w/ the Wants= (weak dependency) property.

Perhaps, Requires= (strong dependency) would be more strict, but it introduces other traits that might not be desired and trigger unexpected transitions (e.g., on stop), thus would need thoughts.

(Wants= is the the recommended way to hook-up the units start-up, per systemd docs [1], and perhaps should be used for Should-Start: as well? That would be a more impactful change up for maintainers.)

The change is apparently not needed for the $/translated units, as most of the units in the system with those don't use Wants=; but for other units we are not sure and Wants= may be required, so let's emit Wants= for these.

[0] https://wiki.debian.org/LSBInitScripts/ [1] https://www.freedesktop.org/software/systemd/man/systemd.unit.html#%5BUnit%5D%20Section%20Options

Signed-off-by: Mauricio Faria de Oliveira mfo@canonical.com

Merge request reports

Loading