Wake-On-Lan (WOL)
Wake on Lan is a process in which a computer is switched on remotely by means of a so-called "Magic Packet". WOL must always be supported by the device to be switched on. In most cases, there is a corresponding setting in the BIOS that must be activated. Without WOL support, an automated shutdown makes no sense, because the server always has to be started manually.
Supports the device WOL, it is sufficient to edit the Ethernet interface (under the condition that the server hangs via Ethernet connection in the network) in the OMV control panel under Network in the Interfaces tab. In the Advanced Settings area, WOL must be activated.
OMV is just an essay for Debian. Therefore, settings can also be made on the command line. If you prefer to make changes here, you can do this using Ethtool. The current configuration can be checked using the following commands:
ethtool eth0
With WOL activated, the output should contain the following two:
Supports Wake-on: pumbg
Wake-on: g
To activate WOL automatically when starting the system, the passage to the Ethnernet interface in /etc/network/interfaces must be completed by the following line:
eth0 network interface auto eth0 allow-hotplug eth0 iface eth0 inet dhcp pre-down ethtool -s $IFACE wol g iface eth0 inet6 manual pre-down ip -6 addr flush dev $IFACE
It is definitely easier to do the configurationin the OMV control panel, but you can check at the commando line if it doesn't work as it should.
Advice: change eth0 with your interface name.
Autoshutdown
To automatically shut down the server, the corresponding package must first be installed:
apt-get install openmediavault-autoshutdown
This is an exclusive function of OMV. A normal Debian system can be shut down on a time-based basis, but not according to certain criteria, for example. In the OMV control panel, the function can be configured in the Services section under Automatic shutdown.
If there are problems, have a look at the log file of the autoshutdown. Located ad:
/var/log/openmediavault-autoshutdown.log
To view the logfile you can use the cli Tools: less or tail.
less /var/log/openmediavault-autoshutdown.log
tail -f /var/log/openmediavault-autoshutdown.log
The less command allows you to view the log file and tail -f will continuosly display new log entries as the are written.