Debian – cron job not running the script that start vncserver

crondebianvnc

Hi I wrote a script to start my vncserver when I call it manually via command line. It works as follows:

  • the script is in usr/bin I gave it the right authorization (chmod u+x startvnc)
  • but wen I test it via cron (* * * * * /usr/bin/startvnc) it doesn't works
  • In the syslog I find : "grandchild #8076 failed with exit status 2"

I'm on a VPS running Debian my VNC is TightVNC.

Best Answer

Why are you going to be running the cronjob continually? Does the script detect if the vnc is currently running and only starts it up if it is not?

If you want vnc to just start up at reboot, use the @reboot cronjob, or put it inside /etc/rc.local.

Not knowing what your use case is or what your script actually does it is hard to assist you with fixing the issue, more information will be needed if the above does not solve your question.

Related Topic