2 Nginx server installed and service nginx restart cant work
It there a way to solve this without rebuilding the server?
I followed this guide for the install of rails and also nginx, which lead to the error.
8 Replies
The links should reside in /etc/rc2.d
hth
Nenad
So how to go from here to solve? Please help.
Really appreciate.
ls -l /etc/rc2.d
and really see that there are two links pointing to etc/init.d/nginx
just delete one link; they are doing the same
if you do
ps aux | grep nginx
you get nginx processes. In normal circumstances you have one master process and more worker processes.
In your case you should have two master processes.
To kill manually one master and his workers you can issue
kill -15 pidnum
where pidnum is the number from the second column (of the master row) that you get with previous ps command.
hth
Nenad
I tried using your method. However when I do ls -l /etc/rc2.d, I can only see 1 nginx link.
Please see the image attached.
~~![](<URL url=)
[https://www.dropbox.com/s/5u890pk40037mzt/Screenshot2.png
which -a nginx
that'll list your nginx binaries. If you installed nginx then installed passenger and nginx you probably do have two versions, one from the package manager and one compiled. Try running
apt-get remove nginx && killall nginx && service nginx start
that will remove the packaged version of nginx, kill all nginx processes and start up the remaining nginx installation
thanks for the reply and help.
I tried what you mentioned
The output for
which -a nginx
is:
/usr/sbin/nginx
and I also tried running:
apt-get remove nginx && killall nginx && service nginx start
the output is
> nx start
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libgd2-noxpm libjpeg-turbo8 libjpeg8 libxslt1.1 nginx-common nginx-full
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
nginx
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
After this operation, 91.1 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database … 51385 files and directories currently installed.)
Removing nginx …
nginx(3382): Operation not permitted
nginx(3383): Operation not permitted
nginx(3385): Operation not permitted
nginx(3386): Operation not permitted
nginx(3388): Operation not permitted
nginx: no process found
Is this normal?
Really appreciate your help
apt-get remove nginx && killall nginx && service nginx start
This is the output"
> nginx start
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package 'nginx' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libgd2-noxpm libjpeg-turbo8 libjpeg8 libxslt1.1 nginx-common nginx-full
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.