Usage

The shutdown helper will auto shutdown the system when nothing important is running right now and set a wakeup timer when needed. It can be used with the recordserver to power on and off the pc for recordings. Start the helper on every system startup in the background.

freevo shutdown start

How the shutdown works

The shutdown helper will auto shutdown the system when nothing important is running right now and set a wakeup timer when needed. It can be used with the recordserver to power on and off the pc for recordings.

On startup the helper will wait at least 30 minutes before doing anything. After that time, it will send a status rpc to all entities on the mbus. it will check 'idle', 'busy' and 'wakeup' from the return. Entities not answering will be ignored. 'idle' is the idle time of an entity (e.g. the Freevo GUI). When the idletime is less than 30 minutes, the system won't shut down. The Freevo GUI will only report an idle time greater zero if it is showing the menu and the idle time will be the time between the last event and the current time in minutes. The 'busy' attribute is a hint how long the entity will be busy (minimum) to give the helper an idea how long to wait. The 'wakeup' attribute defines a wakeup time that will be set using an external program defined in config.SHUTDOWN_WAKEUP_CMD to schedule the wakeup.

If the idle time is lower 30 minutes or an entity is busy, the helper will wait min(max(30 - idletime, busy), 30) minutes before the next check. When an entity joins or leaves the mbus, the timer for the next check will be set to one minute again.

If no entity is against system shutdown the helper will check if important programs are running. Some of this programs are defined in the helper, like wget, encoder and burning applications. The user can add more programs using the config variable SHUTDOWN_IMPORTANT_PROGRAMS. If you use the pc also for daily work and you shut down X at the end, the windowmanager is a good program to add here.

If also no important programs are running, the helper will check login shells using /var/run/utmp using 'who'. An idle time lower 30 minutes on a login shell will also prevent system shutdown. This is usefull when you also use remote logins on this machine.

When nothing would prevent a shutdown, a timer is started. The helper will check all this 5 times with an one minute intervall. If nothing changes on the status, the system will shut down.

TODO

There is a X idletime checker missing. If the user diesn't shut down X and uses software suspend, there is no way to detect user activity on X.

ShutdownHelper (last edited 2008-03-21 15:22:39 by localhost)