Sudo Update-rc.d error while setting up nginx for gateway

Started by lightstar, September 12, 2014, 10:08:24 AM

lightstar

Hi

This is driving me crazyyyy for last couple of days. I have already formated my SD card and started with a new img for 5 times. everything goes smoothly up until when I run this code: 'sudo update-rc.d -f nginx defaults'
then I get :
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default start runlevel arguments (2 3 4 5) do not match nginx Default-Start values (     2 3 4 5)
update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match nginx Default-Stop values (      0 1 6)
insserv: Script nginx is broken: incomplete LSB comment.
insserv: missing valid name for `Provides:' please add.


I started with copying and pasting the codes from the Felix guide on his blog then I thought may be I have to type everything myself but after typing everything exactly the same as the guide, I am still getting this error.


When I also run this 'sudo mkdir /var/www/default'
I get:
mkdir: cannot create directory `/var/www/default': No such file or directory

Please help :-(

Felix

Can you confirm nginx installed correctly?
I have uploaded my nginx init.d file here: https://github.com/LowPowerLab/RaspberryPi-Gateway/tree/master/server_config_files
You can try copying that manually but need to make sure all the paths are correct. I don't know if that will fix your problem. Usually if everything is good, running the update-rc.d nginx defaults command should do all the work for you.

Use the mkdir command to create your dir, just "cd /var/www" then run "sudo mkdir default" in there.

Felix

I just tried the guide again myself, I installed nginx 1.6.1 and had no issues at all, when running sudo update-rc.d nginx defaults i get this message:
using dependency based boot sequencing

lightstar

Thanks a lot Felix. It solved that problem.
Now when I try to restart the nginx using : "sudo service nginx restart"
I get: "Restarting nginx: nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/server.crt:26
nginx."

I tried to re-generate the ssl from beginning but it did not help. By the way I did not change any path and completely followed the guide on your blog.

Felix

You know I have reinstalled everything myself and besides an occasional missing sudo or something like that everything went 100% to plan. So I can't really tell if/where there is a problem. For the ssl issue you will just need to re-verify the paths and regenerate but if you already did ... not sure what to suggest. I installed nginx 1.6.1 but it behaved no different than my first 1.4.2 installation.