I’m not allowed to watch games of the national team of Germany. Currently Germany is playing against Spain. Friends and family have forbidden me to watch the game. Why? All games i have watched were lost be the german national team. This is my curse ;) Thus there will be a second blog entry today, so I don’t start to watch the game.

Think about the situation: You are working on a system. There is a long running task that has to be completed before the next reboot and you want to prevent someone else to reboot the system. Okay, you could write something into the login banner, the motd file or put some other notification for example into your ticketing system. All this in the hope that all people have read this note and act accordingly.

With Solaris 11, there is another possibility. You can stop other users from rebooting the system without taking further steps.

jmoekamp@testbed:~$ sysadm maintain -s -t noreboot -m "Do not reboot. Ask Joerg at ext. 1235"

If I know try to reboot the system, I will get a message about the situation

jmoekamp@testbed:~$ reboot  
system halt/reboot currently disabled. See sysadm(8).

You can check the message with sysadm as well

jmoekamp@testbed:\~$ sysadm maintain -l 
TYPE     USER       DATE             MESSAGE
noreboot jmoekamp   2024-07-05 15:39 Do not reboot. Ask Joerg at ext. 1235

To end this situation you have to end the maintenance mode:

jmoekamp@testbed:$ sysadm maintain -e -t noreboot
jmoekamp@testbed:$ sysadm maintain -l 

There are some important points to keep in mind

  • the noreboot state in a zone won’t prevent the global zone from rebooting with obvious impact to the zone
  • noreboot prevents reboots by halt, reboot, uadmin and shutdown , however panics of the system or cluster failovers are not prevented.
  • A noreboot state is reapplied after the next boot after a panic or after you had a power loss.
Written by

Joerg Moellenkamp

Grey-haired, sometimes grey-bearded Windows dismissing Unix guy.