The parent defines, per weekday, a permitted time range (start–end) and an optional daily usage limit in minutes.
- Tracks logind sessions (
Class == "user"only; greeter/manager sessions are ignored) on the system bus. - Writes the usage minutes of restricted users to
/var/log/user-sessions/{username}.logonce per minute. - Checks whether the session time is over:
- immediately when a restricted user logs in,
- immediately when the preferences change,
- and once per minute.
- When the time is over:
- Emits the
SessionTimeExpired(uid, username, seconds_left)signal on the system bus (tr.org.pardus.ParentalControl). - 11 seconds later terminates the user via logind
TerminateUser.
- Emits the
Listens for the SessionTimeExpired signal and shows the 10 second
countdown popup (NotificationApp.py).
The agent is unprivileged on purpose: it dies instantly on logout (it can not block it), and killing it only hides the popup — the root daemon still terminates the session.