1

I am using Ubuntu 16.04 and have enabled automatic updates and reboots. Version of unattended-upgrades is 0.90ubuntu0.9.

When there is pending reboot and I am logged in to the server I keep getting these notifications to my session:

Broadcast message from root@server (Fri 2018-04-06 10:30:00 EEST):
The system is going down for reboot at Sat 2018-04-07 03:30:00 EEST!

Broadcast message from root@server (Fri 2018-04-06 11:30:00 EEST):
The system is going down for reboot at Sat 2018-04-07 03:30:00 EEST!

Broadcast message from root@server (Fri 2018-04-06 12:30:00 EEST):
The system is going down for reboot at Sat 2018-04-07 03:30:00 EEST!

Broadcast message from root@server (Fri 2018-04-06 13:30:00 EEST):
The system is going down for reboot at Sat 2018-04-07 03:30:00 EEST!

Broadcast message from root@server (Fri 2018-04-06 14:30:00 EEST):
The system is going down for reboot at Sat 2018-04-07 03:30:00 EEST!

Can I prevent these messages from being sent to shell as it is annoying to receice them and the users know that the server may reboot during maintenance window? I checked /etc/apt/apt.conf.d/50unattended-upgrades but I found only email notification settings there.

Madoc Comadrin
  • 218
  • 3
  • 11

1 Answers1

3

There’s no configuration option to do this, but you can disable the broadcast messages by editing the unattended-upgrade script (in /usr/bin) to pass --no-wall to shutdown. Look for a line containing

subprocess.call(["/sbin/shutdown", "-r", when])

and replace that with

subprocess.call(["/sbin/shutdown", "-r", when, "--no-wall"])

You’ll need to do this every time the unattended-upgrades package is upgraded...

(Note that because the shutdown messages are sent by root, they can’t be ignored with mesg n.)

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164