fkbreitl
Posts: 40
Joined: Wed Feb 22, 2017 3:07 pm

Shutdown & reboot button not working in VNC started by cron

Sun Apr 02, 2017 5:25 pm

The PIXEL desktop of Rasbian (Jessie) has a shutdown menu with Shutdown, Reboot and Logout. However, only logout works.

How can I get shutdown and reboot working?
Last edited by fkbreitl on Tue Apr 04, 2017 4:28 pm, edited 2 times in total.

MarkyV
Posts: 97
Joined: Wed Sep 21, 2016 1:52 pm
Location: Buckingham, UK
Contact: Website

Re: Shutdown and reboot buttons of PIXEL desktop not working

Mon Apr 03, 2017 4:21 pm

All three buttons should work (they do on mine) - what may be happening is that something may be running in the background that is not doing its shutdown properly and keeping the OS waiting - is this a plain install or do you have additional hardware/software that has been installed?

Mark
My RaspberryPi Blog: http://thepimaker.online

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5969
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Shutdown and reboot buttons of PIXEL desktop not working

Mon Apr 03, 2017 4:33 pm

If you run 'lxde-pi-shutdown-helper' from a terminal window and try to shutdown, do you see any error messages?

fkbreitl
Posts: 40
Joined: Wed Feb 22, 2017 3:07 pm

Re: Shutdown and reboot buttons of PIXEL desktop not working

Mon Apr 03, 2017 4:43 pm

Thanks for your hint!

As some user I see

Code: Select all

raspberrypi:~$ lxde-pi-shutdown-helper
User pi is logged in on seat0.
User pi is logged in on /dev/tty1.
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl poweroff -i'.
So my first question: How can I ignore the `inihbitor` through this menu?

As user `pi` I see

Code: Select all

raspberrypi:~$ lxde-pi-shutdown-helper
==== AUTHENTICATING FOR org.freedesktop.login1.power-off ===
Authentication is required for powering off the system.
Multiple identities can be used for authentication:
 1.  ,,, (pi)
 2.  root
Choose identity to authenticate as (1-2): Failed to execute operation: Connection timed out
Must be root.
So my second question: What should I change to make it work?

Martin Frezman
Posts: 1020
Joined: Mon Oct 31, 2016 10:05 am

Re: Shutdown and reboot buttons of PIXEL desktop not working

Mon Apr 03, 2017 4:45 pm

And, besides that, what is an 'inhibitor' ?
If this post appears in the wrong forums category, my apologies.

fkbreitl
Posts: 40
Joined: Wed Feb 22, 2017 3:07 pm

Re: Shutdown and reboot buttons of PIXEL desktop not working

Tue Apr 04, 2017 9:18 am

Update:

As I found out this only happens for my VNC desktop.

The reboot button works in the non virtual PIXEL desktop of user pi.

But in VNC I am user `pi`:

Code: Select all

raspberrypi:~$ whoami
pi
Why is this not working in VNC and how can I fix it?

I also discuss this problem at http://raspberrypi.stackexchange.com/q/64287/58211

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5969
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 10:48 am

Seems like a PolicyKit problem. Don't have a solution off the top of my head.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5969
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 11:16 am

What VNC server are you using? I tried RealVNC and it worked great.

fkbreitl
Posts: 40
Joined: Wed Feb 22, 2017 3:07 pm

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 12:05 pm

I am using 'VNC(R) Server 6.0.2 (r26558) ARMv6 (Mar 14 2017 17:00:31), Copyright (C) 2002-2017 RealVNC Ltd.'

Could it be realted to the fact that I start it via pi's crontab with
@reboot local/bin/vnc.sh &

where vnc.sh contains

Code: Select all

#/bin/bash
export SHELL=/bin/bash
vncserver :2 -geometry 1280x720

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5969
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 12:14 pm

Quite possibly. Why not use the service they provide?

fkbreitl
Posts: 40
Joined: Wed Feb 22, 2017 3:07 pm

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 12:26 pm

Because I need another resolution than my HDMI screen.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5969
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 12:54 pm

Do you get a window with an error message when it's first started and you log in?

fkbreitl
Posts: 40
Joined: Wed Feb 22, 2017 3:07 pm

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 12:58 pm

Yes every time something with PID.
I haven't found a solution for it and people suggested to ignore it.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5969
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 1:19 pm

What does it say?

fkbreitl
Posts: 40
Joined: Wed Feb 22, 2017 3:07 pm

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 1:29 pm

A window says
'Error
No session for pid 1438
[Ok]'

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5969
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 2:01 pm

I suspect the right pam modules aren't loaded when you start a process through cron.

fkbreitl
Posts: 40
Joined: Wed Feb 22, 2017 3:07 pm

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 2:04 pm

Makes sense!
And how can I correct this?

Martin Frezman
Posts: 1020
Joined: Mon Oct 31, 2016 10:05 am

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 2:06 pm

Reason #91272 why you shouldn't use 'cron' if you can avoid it.

Don't get me wrong; I know cron well and have used it for decades, but it is kinda "long in the tooth" in the context of modern Linux. The caveats and assumptions underlying it make it a minefield for new users.
If this post appears in the wrong forums category, my apologies.

fkbreitl
Posts: 40
Joined: Wed Feb 22, 2017 3:07 pm

Re: Shutdown & reboot button of PIXEL desktop not working in

Tue Apr 04, 2017 2:15 pm

I am open for alternative VNC startup suggestions.

I have also asked this question at http://raspberrypi.stackexchange.com/q/64393/58211.

Return to “Beginners”