# HG changeset patch # User Alain Leufroy # Date 1614467218 -3600 # Sun Feb 28 00:06:58 2021 +0100 # Node ID 85a05129a9f59a575f6734edf68a6be9a921811e # Parent 5818de7900a4ca91257bd3a4b90948fd9e89d51e edit: restart units only if they were started before diff --git a/overlayctl b/overlayctl --- a/overlayctl +++ b/overlayctl @@ -427,12 +427,19 @@ ] + added if lowers == info['lowers']: return - if 'active' in _systemctl_status(info['automountpath'].name)['Active'].split(): + automounted = _is_automount_active(info) + mounted = _is_mount_active(info) + if automounted: sh.systemctl.stop(info['automountpath'].name) + if mounted: + sh.systemctl.stop(info['mountpath'].name) info = _compute_info(name, lowers) _write_info(info) sh.systemctl('daemon-reload').wait() - sh.systemctl.start(info['automountpath'].name) + if automounted: + sh.systemctl.start(info['automountpath'].name) + if mounted: + sh.systemctl.start(info['automount'].name) logger.debug("Systemd \"%s\" restarted", info['automountpath']) logger.info("\"%s\" updated", info['name'])