Ignore user service on systemd

Instead emit warning about the need to log out and log in again
This commit is contained in:
Fredrik Eriksson 2024-07-26 10:46:59 +02:00
parent c2890da0f3
commit 093470d27d
Signed by: feffe
GPG Key ID: E6B5580B853D322B

View File

@ -141,6 +141,8 @@ def restart_services():
continue continue
elif unit_type != 'service': elif unit_type != 'service':
log.warning(f'not restarting non-service unit "{unit}"; owner of {proc}') log.warning(f'not restarting non-service unit "{unit}"; owner of {proc}')
elif name.startswith('user@'):
log.warning(f'Not restarting user service {unit}; please log out and log in again')
else: else:
_ret, enabled, _err = sau.helpers.exec_cmd([ '/usr/bin/systemctl', 'is-enabled', unit ]) _ret, enabled, _err = sau.helpers.exec_cmd([ '/usr/bin/systemctl', 'is-enabled', unit ])
enabled = enabled.strip() enabled = enabled.strip()