So, this is weird.
I had one of those “events” today where my session spontaneously dropped me back to the login screen and lost track of all my processes — it happens, occasionally, but w/e. So when I logged back in and didn’t see any of the windows I had open, I knew there would be a lot of processes still running from my old session. I logged back out, switched to the console at Ctrl+Alt+F3, and logged in as
root so I could do a
killall -u ferd.
Which worked fine. Until a couple of minutes later, when there were new processes running as
ferd. I killed them again, double-checked that they were all gone… and a couple of minutes later, they were back again!
Now, for Reasons™, I have a
crontab set for my user account (with
crontab -e), and one of the entries executes a script every 3 minutes to diddle some automatically-generated files that get written slightly wrong.
Apparently, every time that cron job fires off, it’s now causing the creation of a user session for my account, controlled by a
/usr/lib/systemd/systemd --user process. And that process is starting all of the user units that I only intend to have running when I’m logged in. Those processes are staying running even after the cron job ends — in fact, a couple of them are daemons, so they never stop running because there’s nothing to terminate those units.
I don’t remember ever seeing this before upgrading to F36, though I can’t rule out the possibility.
I experimentally removed the crontab and the phantom sessions stopped, but they resumed as soon as I put it back in place. So now there’s no doubt it’s cron that’s triggering the
systemd --user process to be started. The sessions don’t show up in
loginctl at all, which says I’m completely logged out even though there are like a dozen processes running under my UID.
Anyone know how to get cron to stop launching user sessions? Or at least to launch them with a different target, so I can specify that it not start things like
gvfs-daemon.service, and etc.?