Timekpr does not support 11.10 Unity and LightDM

Bug #881098 reported by hhlp on 2011-10-24
This bug affects 9 people
Affects Status Importance Assigned to Milestone

Bug Description

In Oneiric 11.10 the default desktop manager is LightDM which is not supported by timekpr.

From the default installation timekpr will not block user login.

Furthermore Unity is not supported to display the timekpr client panel icon.

I think bug #880326 may be related.

hhlp (hhlp-deactivatedaccount) wrote :
Takkat (takkat-nebuk) wrote :

Timekpr can be used in 11.10 with LightDM to setup restrictions for users by adding the following line to /etc/pam.d/lightdm

    account required pam_time.so

(We may need to remove libpam-smbpass to enable user switching until bug #835310 is fixed.)

Unfortunaley so far we haven't found a way to get the timekpr status icon (and notification) displayed. Whitelist 'timekpr' or 'all' for Unity panel did not work any more (it was fine in 11.04)

Takkat (takkat-nebuk) wrote :

To display the timekpr panel icon we need to whitelist 'timekpr' in dconf settings for the Unity panel.

In addition, the timekpr-client needs to be able to run in Unity. To do this timekpr-client.desktop file (see att) needs to be edited as follows:


This 'timekpr-client.desktop file' resides (per default installation) in 'etc/xdg/autostart'

It may be needed to start the timekpr daemon with '/etc/intit.d/timekpr start' for countdown of time granted.

description: updated
Changed in timekpr:
status: New → Confirmed
Takkat (takkat-nebuk) on 2011-10-29
description: updated
summary: - timekpr and pam (pam_time.so)
+ Timekpr does not support 11.10 Unity and LightDM
Thomas Schiex (thomas-schiex) wrote :

I have edited the timekpr-client.desktop file to add Unity;

I have modified the gconf and dconf setting to whitelist all tray icons (set to ['all'] in a last attempt after having tried the addition of 'timekpr')

 I cannot get the systray icon of the client to show. Something I missed ?

BTW, a small typo in the previous post, use '/etc/init.d/timekpr start'

Takkat (takkat-nebuk) wrote :

You may still have old timelog or restriction files in '/var/lib/timekpr'. Try to delete all those for the restricted user and see if that helps.

The icon will not show up when there is any login restriction for the given user. This issue may be connected with the failure to start the daemon that is supposed to immediately log the user out when time limits are reached.

Still I haven' found a way to (re-)start the timekpr daemon when a restricted users logs in. The script in init.d looks o.k.. So I tried with a .desktop file for the daemon in '/etc/xdg/autostart' with no luck. I am not aware of any other method (except maybe an upstart job which I have no experience in) to autostart applications in 11.10..

Any suggestions on this issue?

Percherie (percherie) wrote :

Since the new version of Ubuntu, the time restrictions do not work. Children can connect what they want and when the timer is stuck at maximum.

I did an upgrade Natty => Oneiric instead of a new facility. Maybe the problem come from there.

What should delete it to a brand new installation?

JP Lord (jplord) wrote :

@Percherie : Don't bother going through the hassle of a brand new installation. I did a fresh install and I have the same problem.

I'm sorry to say that the development of timekpr has been stopped. You can
try out gnome nanny <http://projects.gnome.org/nanny/> (search for nanny in
ubuntu software center).

Takkat (takkat-nebuk) wrote :

Savvas, thank you for attention on this. Unfortunately Gnome Nanny still is - uhm - less than stable. As the command line alternative timeoutd was also removed from the repositories we do not have any alternative to timekpr atm.

Do you or anybody else here have an idea on how to debug why timekpr daemon only runs when it was started from the restricted user's account after log in?

JGJones (jgjones) wrote :

It's a shame that Timekpr development have stopped as on previous version of Ubuntu, it've been far more stable and does actually work unlike Gnome-Nanny.

However there's no point switching to Gnome-Nanny, I've reported this bug with Gnome-Nanny here: https://bugs.launchpad.net/ubuntu/+source/nanny/+bug/888205

It doesn't start on 11.10.

Osmo Laitinen (osmo-laitinen) wrote :

Takkat, thanks for the instructions. They did work for me and timekpr seem to work fine again.

Those changes seems to be relatively easy, would it be possible to add those to timekpr package?
Who could do that?

Josef Cacek (josef-cacek) wrote :

I had another type of error on 12.04, the 'users' command used for checking of logged users doesn't return all active users in the Unity. Time of such user is not counted and he's not logged out after expiration of the allowed time.

The problem is in the /usr/share/python-support/timekpr/timekpr.py file, method getusers(), line 124 .

I've used workaround using 'ps -e -o ruser' command instead of 'users'.
Patch is attached.

Percherie (percherie) wrote :

Thank you it works perfectly, I just added the solution to the French documentation

Roman Bazalevsky (rvbglas) wrote :

>I had another type of error on 12.04, the 'users' command used for checking of logged users doesn't return all active users in the Unity.

Not only Unity, any X session not shown by "users" command. Xfce, gnome-fallback - does not matter.

Actually, it is problem not with "users" command itself, but with lightdm, that doesn't update /var/run/utmp.

  ck-history --last-compat|sed -n "s/\([^:]*:[^ ]*\).*still logged in[ ]*/\1/p" | cut -d' ' -f 1 | tr '\n' ' '

Command above works for X sessions.

Roman Bazalevsky (rvbglas) wrote :

sorry for typo

... | cut -d' ' -f 1 | ...

Eric (ericvb69) wrote :

What about using

who | cut -d' ' -f 1


Isn't it easier ?

Abdelaziz Yakout (yooozy) wrote :

@Josef Cacek (josef-cacek) solution worked perfectly on Precise.

eino muidugi (einom) wrote :

this should work for both X and console users

Roman Bazalevsky (rvbglas) wrote :

users/utmp bug fixed in latest lightdm releases, so original version of timekpr works well now.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments