As you can read, for instance here, logind, which is a part of systemd, can set permissions to some devices for user sessions. There's also a vid showing how this kind of behavior works in practice. In short, if you start, let's say, amarok, and you play some song, you will hear the sound till you switch to another user or TTY where you have only the login prompt. That's because the active session became inactive.
I know that you can simply add a user (or users) to a specific group, in this case "audio", and that will 'fix' this issue, but I'm wondering if there's another solution. What I really want is to set some permissions for the process so it could use the sound card all the time, even when all users have their sessions locked.
Is that possible? I'm asking because I often listen to the music and I don't really need my monitor to be on most of the time, so I just lock the screen. But when I lock the screen, the active session becomes inactive and amarok stops playing. And yes, the screen should be locked, and not just turned off.
EDIT:
I don't think that it matters which distro I'm using because if there's systemd on board, it would be the exact same issue. Anyways, I'm using debian sid, but some packages like systemd, udev (and some dependencies) are from experimental branch, and now it's the 219-9 version.
nohup program_x & ; disown
could help. Or using screen – JustMe May 7 '15 at 17:24loginctl enable-linger
for the account? – spuk May 12 '15 at 18:47The systemd user instance is started after the first login of a user and killed after the last session of the user is closed. Sometimes it may be useful to start it right after boot, and keep the systemd user instance running after the last session closes, for instance to have some user process running without any open session. Lingering is used to that effect.
That doesn't concern an inactive user session becausesystemd --user
is present all the time. – Mikhail Morfikov May 12 '15 at 20:33