elogind is logind patched not to demand PID1 privileges. It's the default user login and seat manager in Artix. Clean Artix installations should already have it set up.
People migrating from systemd setups should install elogind and elogind-openrc, elogind-runit, elogind-s6, or elogind-dinit. On openrc, elogind (and dbus) is started on demand and should not need to be explicitly activated; if it isn't, it must be put in the boot runlevel.
For the full article, see: https://wiki.archlinux.org/title/Solid_state_drive#Setting_the_SSD_state_to_%22frozen%22_after_waking_up_from_sleep.
The only thing that needs to be changed is the place where the script is put.
Change /usr/lib/systemd/system-sleep/
to /etc/elogind/system-sleep/
.
Put your script in /etc/elogind/system-sleep
and make it executable. The example below is used to lock the user X screen, which is useful if the session-manager fails to do it:
#!/bin/sh # /lib/elogind/system-sleep/lock.sh # Lock before suspend integration with elogind username=cooluser userhome=/home/$username export XAUTHORITY="$userhome/.Xauthority" export DISPLAY=":0.0" case "${1}" in pre) su $username -c "/usr/bin/slock" & sleep 1s; ;; esac
This "feature" was introduced and made default in systemd 230, without much warning, changing an age-old UNIX behaviour. It's disabled in Artix at compile time, but you can control it in /etc/elogind/logind.conf
by changing the value of KillUserProcesses to your liking.