I updated from Xubuntu 16.04 beta-2 to 16.04 today. And now I can't shutdown my laptop but I am able to restart. When I try it the GUI way it just logging out.
When I tried

sudo shutdown -h now

I got the following error:

Failed to start poweroff.target: Transaction is destructive.
See system logs and 'systemctl status poweroff.target' for details.

Output of /var/log/messages:

tail /var/log/messages
tail: cannot open '/var/log/messages' for reading: No such file or directory

Output of systemctl status poweroff.target

● poweroff.target - Power-Off
   Loaded: loaded (/lib/systemd/system/poweroff.target; disabled; vendor preset:
   Active: inactive (dead)
     Docs: man:systemd.special(7)
share|improve this question
1  
I experience exactly the same on my DELL Precision 5510 with a fresh 16.04 installation. Hope, someone comes up with a solution to this issue. – Bunjip Apr 23 '16 at 14:23
    
@Bunjip I've posted some alternatives to the previous answer – marcanuy Jun 19 '16 at 15:59
    
Thnx @marcanuy - I'll keep this in my mind in case I should ever experience this behaviour again. I ended up re-installing 16.04 from scratch and have not had this issue anymore – Bunjip Jun 20 '16 at 7:41
up vote 2 down vote accepted

I have same problem in my laptop dell Inspiron 5110. After tried this, my computer shutdown normaly

sudo init 0
share|improve this answer
    
Even with this command my laptop (ideapad 500 acz) remains on, while shutdown process is complete. – Sharique May 8 '16 at 8:01
    
I experience the same problem with Ubuntu 16.04. My laptop is an Acer Aspire V 11 Touch. sudo init 0 did not work in my case and led to the same error message. sudo poweroff -f suggested by user marcanuy below worked, although drastically. I should also mention that in my case this has been a one-off incident. After powering on the problem with shutdown has not come up once again. – XavierStuvw Aug 24 '16 at 20:34

The accepted answer sudo init 0 doesn't work for me in Xubuntu based in Ubuntu 16.04.

While waiting for a patch this is how I can shutdown my laptop:

Using poweroff

  • sudo poweroff -f

-f to force the computer to shutdown without contacting the init system.

Detecting the process that prevents the computer to shutdown

In my case there is always the tty process that blocks the poweroff process. So detecting it, killing the process and starting the systemctl target.

  • ps aux | grep tty

    root 983 0.0 0.0 15408 1128 ? Ss 11:49 0:00 /bin/systemd-tty-ask-password-agent --wall

  • Kill the process: sudo kill 983

  • Shutdown the computer: First sudo systemctl start poweroff.target and if it fails execute the command again: sudo systemctl start poweroff.target.

Related questions

share|improve this answer
    
Is the second way preferred? Does shutting down without contacting the init system have risks? – Garrett Dec 29 '17 at 22:50
1  
@Garrett It won't be as safe as using unit, not sure about the risks involved but I never had problems with it, would be interesting to see that in its own question here though. – marcanuy Dec 29 '17 at 23:04

@marcanuy's answer works for me on Ubuntu 16.04. If you want to use the second method in that answer, here is a script you can put in your .bashrc to do that easily:

shutdown_workaround() {
    TTY_PID=$(ps aux | grep -v grep | grep -Po "root +\K[0-9]+(?= .*systemd-tty-ask-password-agent)")
    sudo kill $TTY_PID
    sudo systemctl start poweroff.target || sudo systemctl start poweroff.target
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.