Since upgrading to the latest version of Raspbian, I've been having some problems with using it through TightVNC.
I set up tightvncserver
using the instructions in the official Raspberry Pi documentation, including the part that adds an init.d module to automatically start a VNC server at boot.
Whenever I shutdown or reboot from the GUI (not the command line), or insert or eject a USB flash drive, I am asked for a username and password. This did not happen before upgrading Raspbian. I noticed that the release notes for the latest version say "Removed sudo from shutdown options", which seems like it might be related.
I did some testing with a fresh SD card image, which showed that this problem does not occur when using the Pi directly (through HDMI, not remotely). It also doesn't occur without the init.d module that automatically starts VNC at boot, so if I start the VNC server manually, the Pi acts normally.
This leads me to think that the problem has something to do with the vncboot
Bash script mentioned in the RPi docs:
#! /bin/sh
# /etc/init.d/vncboot
### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO
USER=pi
HOME=/home/pi
export USER HOME
case "$1" in
start)
echo "Starting VNC Server"
#Insert your favoured settings for a VNC session
su - $USER -c "/usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565"
;;
stop)
echo "Stopping VNC Server"
/usr/bin/vncserver -kill :1
;;
*)
echo "Usage: /etc/init.d/vncboot {start|stop}"
exit 1
;;
esac
exit 0
The problem only occurs when the VNC server is started by this script, but not otherwise. Is there anything in this script that looks like it might be the cause of the problem?