Page 1 of 1

Shutdown & reboot button not working in VNC started by cron

Posted: Sun Apr 02, 2017 5:25 pm
by fkbreitl
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?

Re: Shutdown and reboot buttons of PIXEL desktop not working

Posted: Mon Apr 03, 2017 4:21 pm
by MarkyV
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

Re: Shutdown and reboot buttons of PIXEL desktop not working

Posted: Mon Apr 03, 2017 4:33 pm
by ShiftPlusOne
If you run 'lxde-pi-shutdown-helper' from a terminal window and try to shutdown, do you see any error messages?

Re: Shutdown and reboot buttons of PIXEL desktop not working

Posted: Mon Apr 03, 2017 4:43 pm
by fkbreitl
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?

Re: Shutdown and reboot buttons of PIXEL desktop not working

Posted: Mon Apr 03, 2017 4:45 pm
by Martin Frezman
And, besides that, what is an 'inhibitor' ?

Re: Shutdown and reboot buttons of PIXEL desktop not working

Posted: Tue Apr 04, 2017 9:18 am
by fkbreitl
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

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

Posted: Tue Apr 04, 2017 10:48 am
by ShiftPlusOne
Seems like a PolicyKit problem. Don't have a solution off the top of my head.

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

Posted: Tue Apr 04, 2017 11:16 am
by ShiftPlusOne
What VNC server are you using? I tried RealVNC and it worked great.

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

Posted: Tue Apr 04, 2017 12:05 pm
by fkbreitl
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

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

Posted: Tue Apr 04, 2017 12:14 pm
by ShiftPlusOne
Quite possibly. Why not use the service they provide?

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

Posted: Tue Apr 04, 2017 12:26 pm
by fkbreitl
Because I need another resolution than my HDMI screen.

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

Posted: Tue Apr 04, 2017 12:54 pm
by ShiftPlusOne
Do you get a window with an error message when it's first started and you log in?

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

Posted: Tue Apr 04, 2017 12:58 pm
by fkbreitl
Yes every time something with PID.
I haven't found a solution for it and people suggested to ignore it.

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

Posted: Tue Apr 04, 2017 1:19 pm
by ShiftPlusOne
What does it say?

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

Posted: Tue Apr 04, 2017 1:29 pm
by fkbreitl
A window says
'Error
No session for pid 1438
[Ok]'

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

Posted: Tue Apr 04, 2017 2:01 pm
by ShiftPlusOne
I suspect the right pam modules aren't loaded when you start a process through cron.

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

Posted: Tue Apr 04, 2017 2:04 pm
by fkbreitl
Makes sense!
And how can I correct this?

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

Posted: Tue Apr 04, 2017 2:06 pm
by Martin Frezman
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.

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

Posted: Tue Apr 04, 2017 2:15 pm
by fkbreitl
I am open for alternative VNC startup suggestions.

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