I have a service that I've created that worked fine on wheezy but I've just updated to the lastest RPi image and it no longer works.
My script is "/etc/init.d/vncboot" and looks like this:
Code: Select all
### 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
#! /bin/sh
# /etc/init.d/vncboot
USER=root
HOME=/root
export USER HOME
case "$1" in
start)
echo "Starting VNC Server"
#Insert your favoured settings for a VNC session
#/usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565
/usr/bin/vncserver :1 -geometry 1920x1080 -depth 24
;;
stop)
echo "Stopping VNC Server"
/usr/bin/vncserver -kill :1
;;
*)
echo "Usage: /etc/init.d/vncboot {start|stop}"
exit 1
;;
esac
exit 0
I have no idea what's wrong, if I run the script as is it works flawlessly. If I run it using 'service vncboot start' it fails. See below:
Code: Select all
root@rpi:/home/pi# service vncboot start
Job for vncboot.service failed because the control process exited with error code.
See "systemctl status vncboot.service" and "journalctl -xe" for details.
root@rpi:/home/pi# systemctl status vncboot.service
● vncboot.service - LSB: Start VNC Server at boot time
Loaded: loaded (/etc/init.d/vncboot; generated; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2017-12-09 20:39:47 AEDT; 11s ago
Docs: man:systemd-sysv-generator(8)
Process: 1152 ExecStart=/etc/init.d/vncboot start (code=exited, status=203/EXEC)
Dec 09 20:39:47 rpi systemd[1]: Starting LSB: Start VNC Server at boot time...
Dec 09 20:39:47 rpi systemd[1]: vncboot.service: Control process exited, code=exited status=203
Dec 09 20:39:47 rpi systemd[1]: Failed to start LSB: Start VNC Server at boot time.
Dec 09 20:39:47 rpi systemd[1]: vncboot.service: Unit entered failed state.
Dec 09 20:39:47 rpi systemd[1]: vncboot.service: Failed with result 'exit-code'.
root@rpi:/home/pi# /etc/init.d/vncboot start
Starting VNC Server
New 'X' desktop is rpi:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/rpi:1.log