Automatic Reboot on DICE machines

Summary

Including this in a DICE machine's profile:

#include <dice/options/autoreboot.h>

will make the machine start a reboot process if the updaterpms component has requested a reboot.

Options and Caveats

Autoreboot timing
The autoreboot process runs once a day between 11am and 12noon.

Autoreboot delay
By default any reboot triggered by autoreboot is delayed by one week. This may be useful for office machines, for instance: the machine's user will receive several shutdown broadcasts during the week and may choose to reboot the machine at a more convenient time.

Changing the autoreboot delay period
The delay can be changed from the default by defining AUTOREBOOT_DELAY like this:

#include <dice/options/autoreboot.h>

!autoreboot.shutdown_delay   mSET(60)

The shutdown_delay figure is a quantity of minutes so the above example would make a machine reboot after one hour. A delay of 60 minutes might be appropriate for student lab machines, for instance. To make reboots happen immediately, set the delay to 0 (zero).

Permitted leeway
By default there is a leeway of 5 days between the first nag and the scheduling of the reboot. You can alter this to be shorter or longer like this:

!autoreboot.leeway        mSET(10)

Only updaterpms
The default behaviour on DICE machines is to take note of reboot requests from the updaterpms component only.

Adding more components to autoreboot

autoreboot can be told to take note of reboot requests from more components than just the default updaterpms, as in this example:

#include <dice/options/autoreboot.h>
!autoreboot.components       mADD(network)

Cancelling a scheduled shutdown

You can check if a shutdown job has been scheduled using the atq command as root. If you want to remove a scheduled job from the queue then use the atrm command:

[burray]root: atq
14   Thu Sep 19 02:42:00 2019 a root
[burray]root: atrm 14
[burray]root: atq

Cancelling an in-progress shutdown

if autoreboot has started a shutdown process, and you want to cancel the shutdown process, login to the machine, become root and type

/sbin/shutdown -c
to cancel the shutdown. No more autoreboots will be attempted until the machine has been rebooted.

Disabling autoreboot completely

Don't include autoreboot.h smile

If you really must, you can do this:

!autoreboot.active         mSET(false)

-- ChrisCooke - 07 Jun 2007

Topic revision: r4 - 18 Sep 2019 - 08:43:46 - StephenQuinney
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies