On 12 September 2012 11:18, John Woodard mail@johnwoodard.co.uk wrote:
I want to run a vnc server on startup as a user rather than root and seek opinion to where the best place to put the command
tightvncserver :1 -geometry 1280x1024 -depth 16 -pixelformat rgb565
etc/rc.local cron job?
Not sure here really if it needs to be before login so thought it prudent to run as a user.
How about putting a file in /etc/rc2.d/ called S99vncservers_up, adding it to init.d with update-rc.d, the file comprising of something along the lines of:
#####
#!/bin/sh
BINFILE=/usr/bin/vncserver
# bail out gracefully if the package has been removed if [ ! -f $BINFILE ]; then exit 0 fi
vncserver_up() { echo "Starting vncserver for $1" if su $1 --command=$BINFILE then echo "vncserver started ok for user $1" fi }
vncserver_up jenny vncserver_up john
####
Works for me! Jenny