diff --git a/install b/install index 55b4596..5ea996b 100755 --- a/install +++ b/install @@ -17,6 +17,7 @@ SERVICE_FILE = os.path.join(os.path.expanduser(SYSTEM_DIR), SERVICE) PYTHON = sys.executable EXEC_START = f'{PYTHON} {EXEC}' USER = check_output(['logname']).decode('utf-8').strip() +LINGER = check_output(['loginctl', 'show-user', USER, '--property=Linger']).decode('utf-8').strip() with open(SERVICE_TEMPLATE) as f: serviceTemplate = Template(f.read()) @@ -35,3 +36,6 @@ check_call(['systemctl', '--user', 'daemon-reload']) check_call(['systemctl', '--user', 'enable', '--no-pager', SERVICE]) check_call(['systemctl', '--user', 'restart', '--no-pager', SERVICE]) check_call(['systemctl', '--user', 'status', '--no-pager', SERVICE]) + +if LINGER != 'Linger=yes': + print(f'\n>>> Please run `sudo loginctl enable-linger {USER}` to allow this service to run without being logged in.')