1

Starting tightvncserver manually from a terminal works fine. To start it @reboot I am using crontab -e with the following command:

@reboot sleep 20 && /usr/bin/tightvncserver

The path is correct, I tested it using which tightvncserver, but it does not work. I am new to cron, so I do not have experience. What comes to my mind, that there is trouble with the users. Cron does not know, which user should execute this command.

Any help is appreciated!

cerv21
  • 113
  • 1
  • 4

2 Answers2

2

This is how I get it done with cron:

sudo crontab -e

add the line

@reboot su - pi -c '/usr/bin/tightvncserver :1'

This works flawlessly and doesn't come up with the "no pid" error.

ulr
  • 21
  • 3
0

You can start tightvncserver at startup by adding the line into /etc/rc.local.

rc.local starts after all the services are up after the OS start.

Here is rc.local from Raspberry pi documentation.

Chetan Bhargava
  • 1,252
  • 3
  • 15
  • 29