I'm setting up my RPi 2 so I can run VNC from my Mac. I am running Raspbian Jessie Lite, and using this setup
Utilizing the last script for the tightvncserver file:
#!bin/bash
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $remotefs $syslog
# Required-Stop: $remotefs $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
# The Username:Group that will run VNC
export USER=”pi”
#${RUNAS}
# The display that VNC will use
DISPLAY=”1"
# Color depth (between 8 and 32)
DEPTH=”16"
# The Desktop geometry to use.
#GEOMETRY=”x”
GEOMETRY=”800×600"
#GEOMETRY=”1440×900"
#GEOMETRY=”1280×1024"
#GEOMETRY=”1920×1080"
# The name that the VNC Desktop will have.
NAME=”Rasp2_VNC”
OPTIONS=”-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}”
. /lib/lsb/init-functions
case “$1" in
start)
log_action_begin_msg “Starting vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver ${OPTIONS}”
;;
stop)
log_action_begin_msg “Stoping vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver -kill :${DISPLAY}”
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
If I then check
cd /etc/init.d
cat -v tightvncserver
I don't have any carriage returns (^M) in the file
EDIT:
I run the command
sudo /etc/init.d/tightvncserver
sudo: unable to execute /etc/init.d/tightvncserver: No such file or directory
Any suggestions as to why I would be seeing the error: No such file or directory? I obviously can see it when using
ls
or
sudo nano tightvncserver