Cannot usermod -L in LightDM scripts

Posted by user95723 on Ask Ubuntu See other posts from Ask Ubuntu or by user95723
Published on 2012-10-10T15:44:56Z Indexed on 2012/10/10 15:54 UTC
Read the original article Hit count: 215

Filed under:
|
|

I'm running Xubuntu 12.04 and use the LightDM. I want to restrict access to the machine as a kind of parental control. This is how it should work

I hook in a script that executes just before the greeter comes up. Within that script some awk processing will read an entry in a config file and will trigger a usermod -L or usermod -U depending on whether the user is allowed to login.

While user is logged, a cron job will count down the entry in the config and forces a xfce4-session-logout if time is up.

A cron job running on a server will upload the "credits" on a daily base.

How is this idea?

That's theory, now for the problems

It appears for some unknown reason, the usermod command is not executed, neither as part of a display-setup-script nor within the greeter-setup-script. I wrote a small sandbox script

usermod -L johndoe 2>error.txt touch /etc/blabla 2>error.txt

The script is executing, cause the blabla file is existing. That means that the script must have been executed with root privileges. error.txt is empty but the usermod command has just no effect.

Is this a bug or a feature. What's wrong?

Best regards and thank you Oli

© Ask Ubuntu or respective owner

Related posts about xubuntu

Related posts about lightdm