Ubuntu 19.04 restart after shutdown

I have installed Ubuntu 19.04, And I have an issue that Ubuntu Automatically restart after I shut down my laptop.

Ubuntu: 19.04, Machine: Acer V5-471, *single boot

I have tried everything on the internet.

Some solution on the internet I tried, But nothing works 🙁

Ubuntu 16 reboots seconds after shutdown

https://ubuntuforums.org/showthread.php?t=2188726

https://ubuntuforums.org/showthread.php?t=2390730

Ubuntu 18.04 restarting by itself after shutdown

I know there are already plenty questions here related to this one, but I can’t find an answer which solves my problem.

I’ve installed a fresh Ubuntu 18.04 on a Dell Optiplex 9020 SFF. And now I’m trying to make WOL – Wake On Lan – working. The first step I’ve done was to activate WOL in BIOS and deactivate Deep Sleep. And it seems to just work as expected.

I can shutdown PC and wake it up with a magic packet (and do it an unlimited number of times).

But if I choose to restart/reboot, the PC will do it normally and then if I try to shut it down (with the button on the top-right of the screen (or with a shutdown now, shutdown -H now) it will shutdown, wait 3 seconds, and then reboot by itself. The only way to shut it down is to long press the hardware power button. And then it reworks as expected (with WOL) until the next reboot/restart is issued.

I’ve tried several things in /etc/default/grub like adding acpi=force apm=power_off or noapic or reboot=a,w followed by an update-grub. I’ve also updated my BIOS to latest version (A25). But nothing works.

I think the problem is when I trigger a reboot, something change somewhere and make following shutdown working a bit differently and cause computer to reboot by itself.

I’ve maybe a clue after investigating journalctl. When I trigger a normal shutdown (without a reboot before):

sept. 07 00:57:28 barbie systemd[1]: Reached target Shutdown. sept. 07 00:57:28 barbie systemd[1]: Reached target Final Step. sept. 07 00:57:28 barbie systemd[1]: Starting Power-Off... sept. 07 00:57:28 barbie systemd[1]: Shutting down. sept. 07 00:57:28 barbie kernel: printk: systemd-shutdow: 40 output lines suppressed due to ratelimiting sept. 07 00:57:28 barbie systemd-shutdown[1]: Syncing filesystems and block devices. sept. 07 00:57:28 barbie systemd-shutdown[1]: Sending SIGTERM to remaining processes... sept. 07 00:57:28 barbie systemd-journald[431]: Journal stopped 

And when I trigger a shutdown (with a reboot before):

sept. 07 00:59:08 barbie systemd[1]: Reached target Shutdown. sept. 07 00:59:08 barbie systemd[1]: Reached target Final Step. sept. 07 00:59:08 barbie systemd[1]: Starting Power-Off... sept. 07 00:59:08 barbie systemd[1]: Shutting down. sept. 07 00:59:08 barbie kernel: printk: systemd-shutdow: 39 output lines suppressed due to ratelimiting sept. 07 00:59:08 barbie systemd-shutdown[1]: Syncing filesystems and block devices. sept. 07 00:59:08 barbie systemd-journald[426]: Journal stopped 

Note the missing line: systemd-shutdown[1]: Sending SIGTERM to remaining processes... Maybe it explains why the computer reboot by itself ?

That’s all I’ve done so far. Your clues/ideas are welcome. Thanks!

How can I fix the sudden shutdown of Android device when USB tethering on Lubuntu 18.04?

I have experienced 2 problems for USB tethering on Lubuntu 18.04 First: I try to USB tethering from Android 4.4.4 Samsung Galaxy Grand smartphone to Lubuntu 18.04 32-bit desktop computer but Android device asks me PIN code for SIM card a few second after connecting USB cable. And then Android device chills although I enter the PIN code. And I have to disconnect USB cable and reboot the Android device. Second: I try to USB tethering from Android 5.1.1 Everest tablet to Lubuntu 18.04 64- bit desktop computer. As soon as connecting, tablet suddenly restarts. and so I failed tethering. Is there any way to cope with these vexing problems ? Thank you.

Erase /home/ from casper-rw overlay on shutdown (systemd service)

In my company we use a USB bootable live stick with Ubuntu (erm… Xubuntu) 18.04 to do job interviews. It has a bunch of tools (three or four IDEs, a couple of database GUI viewers…) and a toy project to ask questions about.

That USB stick has a Casper-RW overlay partition for persistent storage (created with mkusb). Said partition is mostly used to store Docker images and to keep some start-up values that can change a bit depending on which machine the stick is plugged into.

That partition is mounted “manually” in /media/overlay by adding the following line mkdir --parents /media/overlay/ && mount -L casper-rw /media/overlay/ to the file rc.local (thank you @sudodus for answering my previous question).

Now, that casper-rw persistance layer is working great… Maybe too great. We would like to erase the /home/<user> directory where the .bash_history and other changes made by the interviewee have been stored when we shut down the test environment (test environment… meaning: the laptop where the interviewee has been doing stuff).

Thanks to these answers (Unix&Linux, AskUbuntu) I created a systemd service that… kindaaaa does what I want, it’s just it seems to do it when the system boots, not when it’s going down. Is not a huge deal, is just… it bugs me a little 😀

This is the systemd service I created in /etc/systemd/clear-stick.service:

[Unit] Description=Cleans-up interview sticker RequiresMountsFor=/media/overlay/ DefaultDependencies=no Before=shutdown.target reboot.target halt.target umount.target casper.service  [Service] Type=oneshot ExecStart=/usr/local/bin/clear_interview_stick.sh ExecStop=/usr/local/bin/clear_interview_stick.sh RemainAfterExit=true  [Install] WantedBy=multi-user.target 

I suspect it’s only running the ExecStart line on boot, rather than the ExecStop line on shutdown. If I make changes to the /home/ directory, power off the computer and mount the stick somewhere else, the changes are still there. Plus, if I look at the logs in journcalctl I only see references to Cleans-up interview sticker surrounded by what seems start sequences of other services. Yet, I’m not 100% sure whether this happens because the .service definition is wrong (very likely) or because I don’t fully understand how the casper-rw overlay works and eventhough the .service is run on shutdown, it can’t clear the /media/overlay/home/interviewee directory?.

And just in case it’s relevant, this is the content of /usr/local/bin/clear_interview_stick.sh:

#!/bin/bash  had_to_mount="false"; if [[ ! -d "/media/overlay/upper/" ]]; then     mount -L casper-rw /media/overlay/     had_to_mount="true"; fi  if [[ -d "/media/overlay/upper/home/interviewee/" ]]; then     echo "Removing interviewee /home";     rm -rf "/media/overlay/upper/home/interviewee/"; else     echo "interviewee /home/ not found" fi  if [[ -f /root/.bash_history ]]; then     rm /root/.bash_history; fi  if [[ "$  {had_to_mount}" == "true" ]]; then        umount /media/overlay; fi         

DNS Records are removed after VM shutdown

Exactly the same problem as described here: https://social.technet.microsoft.com/Forums/en-US/db44ea7b-43f4-44a3-8df3-a0608414f15c/static-dns-record-gets-removed-when-dhcp-client-shutdown?forum=ws2019

I got an Ubuntu Linux 18.04.2 VM which is in an (IPv4) DHCP-based network. For some strange reason my DNS A record and reverse record is (nearly instantly) removed from my DNS servers on shutting down the VM (and recreated upon starting the machine again).

Is there any way to prove it’s not the VM?

The machine is vanilla, using the stock dhclient with no custom config. /etc/network/interfaces is configured like that:

# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5).  # The loopback network interface auto lo iface lo inet loopback  # The primary network interface auto eth0 iface eth0 inet dhcp 

/var/log/syslog (greping for dhclient shows the following information):

Jul 29 11:57:37 sq dhclient[9416]: Killed old client process Jul 29 11:57:38 sq dhclient[9416]: Internet Systems Consortium DHCP Client 4.3.5 Jul 29 11:57:38 sq dhclient[9416]: Copyright 2004-2016 Internet Systems Consortium. Jul 29 11:57:38 sq dhclient[9416]: All rights reserved. Jul 29 11:57:38 sq dhclient[9416]: For info, please visit https://www.isc.org/software/dhcp/ Jul 29 11:57:38 sq dhclient[9416]: Jul 29 11:57:38 sq dhclient[9416]: Listening on LPF/eth0/00:50:56:85:36:f8 Jul 29 11:57:38 sq dhclient[9416]: Sending on   LPF/eth0/00:50:56:85:36:f8 Jul 29 11:57:38 sq dhclient[9416]: Sending on   Socket/fallback Jul 29 11:57:38 sq dhclient[9416]: DHCPRELEASE on eth0 to 192.168.0.9 port 67 (xid=0x39f2acec) Jul 29 12:10:06 sq dhclient[9548]: Internet Systems Consortium DHCP Client 4.3.5 Jul 29 12:10:06 sq dhclient[9548]: Copyright 2004-2016 Internet Systems Consortium. Jul 29 12:10:06 sq dhclient[9548]: All rights reserved. Jul 29 12:10:06 sq dhclient[9548]: For info, please visit https://www.isc.org/software/dhcp/ Jul 29 12:10:06 sq dhclient[9548]: Jul 29 12:10:06 sq dhclient[9548]: Listening on LPF/eth0/00:50:56:85:36:f8 Jul 29 12:10:06 sq dhclient[9548]: Sending on   LPF/eth0/00:50:56:85:36:f8 Jul 29 12:10:06 sq dhclient[9548]: Sending on   Socket/fallback Jul 29 12:10:06 sq dhclient[9548]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x620e7229) Jul 29 12:10:06 sq dhclient[9548]: DHCPREQUEST of 192.168.0.53 on eth0 to 255.255.255.255 port 67 (xid=0x29720e62) Jul 29 12:10:06 sq dhclient[9548]: DHCPOFFER of 192.168.0.53 from 192.168.0.9 Jul 29 12:10:06 sq dhclient[9548]: DHCPACK of 192.168.0.53 from 192.168.0.9 Jul 29 12:10:09 sq dhclient[9548]: bound to 192.168.0.53 -- renewal in 39872 seconds. 

So no surprises here, either.

18.04 Ubuntu does not shutdown properly on laptop

I have a Gigabyte p25x-v2 laptop which I have only upgraded SSD from 250 * 2 GB RAID to 1TB + 500GB.

Here are some more detailed specifications

  • CPU: i7-4810MQ
  • GPU: GTX 880M
  • RAM: 8 * 2 GB
  • SSD 1: Evo 860 mSATA 1TB
  • SSD 2: Evo 860 mSATA 500GB
  • HDD: 1TB

SSD 1 is used for Windows OS and SSD 2 is separately used for Ubuntu OS while HDD is used for data storage only.

Firmware for both SSDs and BIOS are up-to-date, secure boot option is off and I have tested on a complete mint condition of Ubuntu 18.04, but it still does not shut down and stays as shown below screenshot.

Screenshot

I have seen many laptop users with Windows + Ubuntu dual booting system having similar issue as mine, but the difference is that:

  1. I have two different OS installed on two different SSD as I mentioned earlier
  2. I have no re-boot issue, but shut down issue only.

This is really, really and really driving me crazy and I am eager to fix this issue…

It would have been easier if I got any sort of error message, but I am not getting any…

How do I get my network (lan) card to power down on computer shutdown

In Windows when I shut down my computer the network card powers off as well.

In Ubuntu when I power down the network card powers off for a second (at least going by the lan light on my router) but then powers back on.

I know this is to allow wake on lan but I have no need or desire to wake the computer.

How do I do this in Ubuntu?

I am willing and capable of using terminal commands, but if you are going to give them to me please explain what they do as well. Other than safety, which is not really a concern on this sight, the other users will pounce on an unsafe command, it is hard to learn if commands are just thrown out with no explanation.

I would prefer the Lan card to shut off in both power off and sleep but will settle for power off only.

MacBook Pro restores last user session after shutdown because of low battery

I never noticed that before as I had only account on my Mac but since I created one for my son, when I have a session opened and close the lead and leave the Mac until it shuts down because of low battery, if my son glugs it and starts it, when he arrives on the login screen and selects his user, it connects him to my last used session. I can’t tell why it does that and how to prevent it. We have two different accounts and passwords of course. So it looks like it restores the last session that was runnign before the power loss. Any idea? I have some security concerns on this…

Shutdown ESXi 6.7 with a script via SSH without entering maintenance mode

I’m trying to write a script that ssh’s to an ESXi 6.7 and shuts down the host and also shuts down the VMs according to the current system shutdown policy.

I’m running Dell customized image ESXi 6.7 in a Dell R710 with a dual Xeon X5650 and 144GB RAM.

In fact what I want is the same that I can get with:

Shutdown via GUI

Shutdown via console

I have ssh enabled in the server.

I already tryed:

1) host_shutdown.sh (it just gets there indefinitely).

2) /bin/host_shutdown.sh (it to gets there indefinitely).

3) halt (shutdowns the server but it does not shuts down the VMs)

I also tried:

esxcli system shutdown poweroff --reason I_want_IT 

but the system must be in maintenance mode and I want to do it without entering maintenance mode

I then discovered this thread here in Server Fault, but it does not work in my server (I suppose it only runs on ESXi 5):

How do I shutdown the Host over ssh on ESXi 5 so it shuts down the guests properly?

I think I’m too dumb to discover on my own how to do it, because I presume it must be a simple thing to do.