I am running my the PIXEL desktop of Rasbian (Jessie) in VNC started by cron. In this case the Shutdown and Reboot of the shutdown menu do not work (only Logout).
How can I get shutdown and reboot working?
From the discussion at the RPi Forum this problem seems to happen in a VNC desktop started through the user's crontab via @reboot vncserver &
since the cron environment is restricted and prevents (PAM?) from working correctly. The problem shows up when I start the button script in a shell and click on reboot
:
raspberrypi:~$ lxde-pi-shutdown-helper
Failed to execute operation: Access denied
Must be root.
Interestingly when I ssh in as user pi
I get:
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):
So lxde-pi-shutdown-helper
seems to be a complex program which I would like to understand and use better in VNC.
A similar issue is Get Bash instead of /bin/sh in a VNC session started by cron.
What does it take to run lxde-pi-shutdown-helper
correctly?
1
and type thepi
user's password, it should work.)lxde-pi-shutdown-helper
to work and the other question is about starting VNC through cron without limitations. Now when I click the shutdown button I don't get this menu so I can't follow your suggestion.lxde-pi-shutdown-helper
from the command line and choose1
from the menu above, does the Pi then correctly shut down? And do you have to type a password when you do that? (I.e., did you add a password to your account?)gksudo lxde-pi-shutdown-helper
I can reboot by clicking the reboot button. Otherwise I seeFailed to execute operation: Access denied Must be root.
And yes my users have passwords.