You are not logged in.
Happy New Year everyone!!
I have a question: are there any special rules one has to follow when using systemd commands via cron?
I run KDE on an up-to-date system.
I have a script in $HOME/bin that should automatically log off my workstation at the end of the day but it does not.
The script works as expected if I do "~/bin/dayend" but it will not run via cron.
The code in question:
#!/bin/bash
loginctl lock-session
Thanks for any ideas.
Offline
This turned out to be interesting.
It seems that if I run:
pkill -KILL -u ralvez
I'm OK. It runs just fine.
But ... if I run loginctl which is also in /usr/bin/ it refuses to do it.
Now, of course, I would prefer not to use pkill over loginctl because the former kills not only the session but all processes therein.
If someone has an idea to accomplish the task I'll be happy to hear it.
R.
NOTE: To say "it resuses to do it" is not accurate. Actually it just fails silently I have no grounds to say that it "refuses" to run as a cron command.
Last edited by ralvez (2019-01-04 23:49:25)
Offline