-1

I have used this script for tightvnc

#!/bin/sh
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start vnc server
# Description:
### END INIT INFO

case “$1” in
start)
su pi -c ‘vncserver :1 -geometry 1600×900 -depth 16 -pixelformat rgb565:’
echo “VNC Started”
;;
stop)
pkill Xtightvnc
echo “VNC Terminated”
;;
*)
echo “Usage: /etc/init.d/tightvnc {start|stop}”
exit 1
;;
esac

Then while running the following command sudo update-rc.d tightvnc defaults

I am getting error -bash: insserv:: command not found pi@raspberrypi:~ $ insserv: missing `Provides:' entry: please add.

insserv: missing Required-Start:' entry: please add even if empty. insserv: missingRequired-Stop:' entry: please add even if empty. -bash: command substitution: line 1: unexpected EOF while looking for matching '' -bash: command substitution: line 3: syntax error: unexpected end of file -bash: insserv:: command not found pi@raspberrypi:~ $ insserv: missingDefault-Start:' entry: please add even if empty. insserv: missing Default-Stop:' entry: please add even if empty. insserv: Default-Start undefined, assuming empty start runlevel(s) for scripttightvnc' -bash: command substitution: line 1: unexpected EOF while looking for matching '' -bash: command substitution: line 3: syntax error: unexpected end of file -bash: insserv:: command not found pi@raspberrypi:~ $ insserv: Default-Stop undefined, assuming empty stop runlevel(s) for scripttightvnc' -bash: syntax error near unexpected token (' pi@raspberrypi:~ $ ^C pi@raspberrypi:~ $ pi@raspberrypi:~ $ clear pi@raspberrypi:~ $ sudo update-rc.d tightvnc defaults insserv: Script tightvnc is broken: incomplete LSB comment. insserv: missingProvides:' entry: please add. insserv: missing Required-Start:' entry: please add even if empty. insserv: missingRequired-Stop:' entry: please add even if empty. insserv: missing Default-Start:' entry: please add even if empty. insserv: missingDefault-Stop:' entry: please add even if empty. insserv: Default-Start undefined, assuming empty start runlevel(s) for script tightvnc' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for scripttightvnc' pi@raspberrypi:~ $

What is the problem here?

1 Answers1

0

You are attempting to run a SysV script on Jessie.

If you want this to run at startup this should be started with a systemd service. See:- https://raspberrypi.stackexchange.com/a/39374/8697 Start VNC on Jessie at boot

Milliways
  • 59,890
  • 31
  • 101
  • 209