MeidokonWiki:

Has been decommissioned on 2019-11-15

users

services

websites

systemd notes

I tried to do some nice things here so that each user can manage their own daemons, but it ended up being more of a problem than a help. I mean it works, but I don't know why it doesn't reliably autostart and whatnot. Good idea though.

https://wiki.archlinux.org/index.php/Systemd/User

It's also viable to run a screen session via systemd, as a user-owned unit.

root@shimakaze:/home/furinkan/.config/systemd/user# cat screen-session-irssi.service 

[Unit]
Description=Run a screen session for irssi

[Service]
Type=simple
ExecStart=/usr/bin/screen -DmUS irssi /usr/bin/irssi
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

A directory structure like this will do it:

root@shimakaze:/home/furinkan/.config/systemd/user# ls -lh
total 8.0K
lrwxrwxrwx 1 furinkan furinkan   23 Jun 24  2015 default.target.wants -> multi-user.target.wants
drwxr-xr-x 2 furinkan furinkan 4.0K Nov  2  2018 multi-user.target.wants
-rw-r--r-- 1 furinkan furinkan  196 Jun 24  2015 screen-session-irssi.service

One more part of the trick is that you need to set a flag somewhere, or create a file, that tells systemd to run an instance per user. I forget where that is though.

Edit: aha here it is, you enabling "lingering": loginctl enable-linger their_username

MeidokonWiki: servers/shimakaze (last edited 2019-11-15 16:44:38 by furinkan)