/etc/init.d/nginx not executable
Asked Answered
S

1

6

I searched on the internet for a while now and I don't find a solution so I am asking here: My question is, why is this file (/etc/init.d/nginx) not executeable?

I was following the tutorial of Alex yesterday and I got into an issue. Everything worked until the service nginx restart-command. When I try to run this command I will get

 nginx: You don't have permissions to execute nginx.

After googling some time I found a potential answer, but this was already done in the tutorial/walkthrough of Alex:

 $ sudo chmod +x /etc/init.d/nginx

Some info if you don't want to read the tutorial:

  • I am using Nginx (as you will know when reading this bit)
  • It's installed it with Passenger and then imported a Nginx Init-script and the nginx.conf file from scratch.
  • Oh and I am running Debian instead of Ubuntu, but that shouldn;t be the problem, or?

So I would be very thankful if anyone could help me. Thanks!

Sg answered 25/1, 2014 at 8:23 Comment(9)
why not run sudo service instead of just serviceOptometrist
I also tried ’sudo’ but it also doesn't help. I am also the root user.Sg
sudo service nginx start said no permissions ?Optometrist
From today on it just don't return anything.Sg
then maybe there is something wrong with your nginx, try running sudo nginx -t i think that is how you test your nginx configurationOptometrist
So, now the next problem is: I get permission error. But I figured out that I can use the ’nginx’ command to start the server including Passenger. Thanks for your help. But I also would like to access the init script.Sg
Did you ever figure out the problem?Fief
I am also having the same problem did you find solution for thisHephzipa
@Magnum I reseted my server and done it after my own instructions: gist.github.com/iDuuck/708a7e2aa0d851a738edSg
B
8

Make sure the variables in your init script are correct:

Here's an example script: http://wiki.nginx.org/Nginx-init-ubuntu

For instance, I had to change NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" to NGINX_CONF_FILE="/etc/nginx/nginx.conf" and it solved my problem.

Braden answered 5/2, 2014 at 10:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.