<SOLVED>Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
<SOLVED>Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
Hello all,
A year ago I did build a small backup server. I do not want this server to run all day so I tried to use wake up lan. The backup program I use on the PC which needs to access the server is lucky backup, I like this program because it is small and it accepts command line commands. You can use command line commands before the backup starts and when the backup is done.
This works fine, when I do wakeonlan macaddress the server boots up. When the backup is done I can do: "ssh username@ipaddress sudo shutdown -P now" this makes the server shutdown. But when I try the wakeonlan command after the shutdown command the server will not boot. I did also try to shut down the server with the shutdown button in X-windows, when I use this method, wakeup-lan works. The server uses linux mint 17 Mate.
Can anyone please tell me how to fix this problem?
A year ago I did build a small backup server. I do not want this server to run all day so I tried to use wake up lan. The backup program I use on the PC which needs to access the server is lucky backup, I like this program because it is small and it accepts command line commands. You can use command line commands before the backup starts and when the backup is done.
This works fine, when I do wakeonlan macaddress the server boots up. When the backup is done I can do: "ssh username@ipaddress sudo shutdown -P now" this makes the server shutdown. But when I try the wakeonlan command after the shutdown command the server will not boot. I did also try to shut down the server with the shutdown button in X-windows, when I use this method, wakeup-lan works. The server uses linux mint 17 Mate.
Can anyone please tell me how to fix this problem?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
that command - "ssh username@ipaddress sudo shutdown -P now" - shut's the machine down.
ie: to use another command , that will place the machine into a sleep, rather than a shutdown.
that doesn't have to be in 'Hibernation' either, - rather just into a 'sleep' mode,
& yeah - -that will also consume a bit of power, whilst 'asleep'.
ie: to use another command , that will place the machine into a sleep, rather than a shutdown.
that doesn't have to be in 'Hibernation' either, - rather just into a 'sleep' mode,
& yeah - -that will also consume a bit of power, whilst 'asleep'.
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Re: Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
Hello Pierre, than you for your reply. Sleep might be a nice workaround. Still I wonder though why clicking shutdown in the X-windows works and the shutdown command in the console does not work. Is there a way to check what the shutdown command in X-windows does and just copy it to the console?Pierre wrote: ⤴Wed Jun 13, 2018 9:03 am that command - "ssh username@ipaddress sudo shutdown -P now" - shut's the machine down.
ie: to use another command , that will place the machine into a sleep, rather than a shutdown.
that doesn't have to be in 'Hibernation' either, - rather just into a 'sleep' mode,
& yeah - -that will also consume a bit of power, whilst 'asleep'.
Re: Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
To shutdown the system:
To restart:
& one more command for restart:
Another way as one of the user mentioned.
For shutdown:
or:
For restart:
You can get more info on the shutdown command by using one of the following:
shutdown --help
man shutdown
Code: Select all
sudo shutdown -h now
Code: Select all
sudo reboot
Code: Select all
sudo shutdown -r now
For shutdown:
Code: Select all
sudo halt
Code: Select all
sudo init 0
Code: Select all
sudo init 6
shutdown --help
man shutdown
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Re: Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
another way, would be:
EDIT: yes - it does seem to be already installed.
but, I'm not sure if the PM-command is pre-installed, or not.The command for sleep or suspend, is pm-suspend. pm-suspend is included in the pm-utils package,
- on Debian, Ubuntu, Linux Mint, Pinguy, Knoppix and other Debian based distros.
Suspend Linux Box: sudo pm-suspend
To send your computer to hibernation, use pm-hibernate.
Hibernate Linux Box: sudo pm-hibernate
You can also hybrid suspend your computer, with pm-suspend-hybrid.
The hybrid command saves the hard disk session and keeps the system on, allowing a the computer to fast resume.
Hybrid Suspend Linux Box: sudo pm-suspend-hybrid
All, the pm-* tools (pm-suspend, pm-hybernate, pm-suspend-hybrid) are included in the pm-utils package.
EDIT: yes - it does seem to be already installed.
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Re: Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
Hello Piere,
Think I did find somethings:
The -H halts the system then I see the mint symbol and nothing works anymore then I need a hard reset, pushing the button on the server.
ssh xxxx@xxxxxxx sudo shutdown -h now
seems to work. But only when I do log in in the X-windows like type the pasword in the x-windows on the server keyboard. Then I can shutdown the server from a other machine with the command above. Then I can use the wake on lan command from a other machine to boot the server. again. does this give the right information to fix the problem?
thanks for the help
Think I did find somethings:
The -H halts the system then I see the mint symbol and nothing works anymore then I need a hard reset, pushing the button on the server.
ssh xxxx@xxxxxxx sudo shutdown -h now
seems to work. But only when I do log in in the X-windows like type the pasword in the x-windows on the server keyboard. Then I can shutdown the server from a other machine with the command above. Then I can use the wake on lan command from a other machine to boot the server. again. does this give the right information to fix the problem?
thanks for the help
Re: Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
I tried the following:
(1)boot the server
(2)login to x-windows on the server, using the keyboard connected to the server
(3)log user out of x-windows on the server, using the mouse connected to the server
(3)"ssh user@ip-address sudo shutdown -h now" from the NON server machine, the server shuts down
(4)"wakeonlan mac address" from the NON server machine, this makes the server boot
If I do not do step (2) and (3) the server will not boot when I do (4)
This makes me think it is not the shutdown command which is causing the problem but it is some configuration which takes place when I log into X-windows. I hope this information helps and some-one can tell me what to do. Thank you all for the help.
(1)boot the server
(2)login to x-windows on the server, using the keyboard connected to the server
(3)log user out of x-windows on the server, using the mouse connected to the server
(3)"ssh user@ip-address sudo shutdown -h now" from the NON server machine, the server shuts down
(4)"wakeonlan mac address" from the NON server machine, this makes the server boot
If I do not do step (2) and (3) the server will not boot when I do (4)
This makes me think it is not the shutdown command which is causing the problem but it is some configuration which takes place when I log into X-windows. I hope this information helps and some-one can tell me what to do. Thank you all for the help.
Re: Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
I use a utility from the repositories powerwake
then pass:
in the terminal or via script
then pass:
powerwake <mac address>
in the terminal or via script
Everything in life was difficult before it became easy.
Re: Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
I also did the following:
"sudo ethtool eth0" via ssh on the server before I did log into x-windos I got this:
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: pg
Wake-on: d
Current message level: 0x0000003f (63)
drv probe link timer ifdown ifup
Link detected: yes
"sudo ethtool eth0" via ssh on the server logged in x-windows I got this:
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: pg
Wake-on: g
Current message level: 0x0000003f (63)
drv probe link timer ifdown ifup
Link detected: yes
So then I tried to do "sudo ethtool -s eth0 wol g" before logging into x-windows and then the wak-on lan did work again. Now I need to find a way to enable the "g" option before the x-windos loging. Any suggestions are welcome.
"sudo ethtool eth0" via ssh on the server before I did log into x-windos I got this:
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: pg
Wake-on: d
Current message level: 0x0000003f (63)
drv probe link timer ifdown ifup
Link detected: yes
"sudo ethtool eth0" via ssh on the server logged in x-windows I got this:
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: pg
Wake-on: g
Current message level: 0x0000003f (63)
drv probe link timer ifdown ifup
Link detected: yes
So then I tried to do "sudo ethtool -s eth0 wol g" before logging into x-windows and then the wak-on lan did work again. Now I need to find a way to enable the "g" option before the x-windos loging. Any suggestions are welcome.
Re: Wakeon lan works only afther shutting down with X-win NOT with console shutdown command
I did ask someone on irc and he told me to put the following script:
#!/bin/sh
set -e
if [ "$IFACE" = lo ]; then
exit 0
fi
if [ "$MODE" != start ]; then
exit 0
fi
/sbin/ethtool -s $IFACE wol g
into a file in the following directory:
/etc/network/if-up.d/
and make it chmod +x
when I did this the wake-on was g and not d before logging into X-windows and the server can now do wake-on-lan after a shutdown! It seems to work! Thanks for the help all!
#!/bin/sh
set -e
if [ "$IFACE" = lo ]; then
exit 0
fi
if [ "$MODE" != start ]; then
exit 0
fi
/sbin/ethtool -s $IFACE wol g
into a file in the following directory:
/etc/network/if-up.d/
and make it chmod +x
when I did this the wake-on was g and not d before logging into X-windows and the server can now do wake-on-lan after a shutdown! It seems to work! Thanks for the help all!