[Unit] Description=im: the family's sign-in provider (OpenID Connect), as a user service # No network-online.target: it is a system unit that a user manager cannot see, and im binds 127.0.0.1. StartLimitIntervalSec=60 StartLimitBurst=5 [Service] Type=simple # Runs as the account that owns this unit (for example `apps`), under its user manager. No User= or Group=. # The binary is installed by kur into ~/bin/im. The config must use absolute paths: im does not expand "~" # (its paths are used as given, and relative ones resolve against the working directory below). Point # database, data_dir and [backup] dir under ~/.local/state/im, for example /home/apps/.local/state/im/data/im.db. Environment=IM_CONFIG=%h/.config/im/im.toml ExecStart=%h/bin/im serve # StateDirectory creates ~/.local/state/im (mode 0700) before start; the working directory is that directory. StateDirectory=im StateDirectoryMode=0700 WorkingDirectory=%S/im Restart=on-failure RestartSec=2 LimitNOFILE=65536 # A photo decode may use up to 96 MiB and two run at once; this leaves room for that and the rest. MemoryMax=1G UMask=0077 # Hardening. Only the options a user manager applies without special privileges. The namespace-based options # of the system unit (ProtectSystem, PrivateTmp, ProtectHome, PrivateDevices, and the rest) are left out: # a user manager can apply them only where unprivileged user namespaces are available. NoNewPrivileges=yes LockPersonality=yes RestrictRealtime=yes RestrictSUIDSGID=yes MemoryDenyWriteExecute=yes SystemCallArchitectures=native SystemCallFilter=@system-service SystemCallFilter=~@privileged RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 [Install] WantedBy=default.target