0

I am setting up both Nginx and OpenRusty on my Ubuntu , one thing confuses me is , even after I quit OpenRusty and stop Nginx , I can still observe a nginx running , seems like this process cannot even be killed , My question is who launch this nginx and why this nginx daemon is always running ?

ps -aux | grep nginx
root      3779  0.0  0.0  10776  6180 ?        Ss   06:57   0:00 **nginx: master process nginx -g daemon off;**
systemd+  4587  0.0  0.0  11172  2756 ?        S    06:57   0:00 nginx: worker process
jia      17315  0.0  0.0  16184  1068 pts/0    S+   07:08   0:00 grep --color=auto nginx

I tried systemctl to stop it , seems nginx still running

sudo systemctl stop nginx.service
 
 sudo systemctl status nginx.service 
● nginx.service - The NGINX HTTP and reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

 sudo ps -aux | grep nginx root 3779 0.0 0.0 10776 6180 ? Ss 06:57 0:00 nginx: master process nginx -g daemon off; 
    systemd+ 4587 0.0 0.0 11172 2756 ? S 06:57 0:00 nginx: worker process
2
  • how's about to use kill 3779 4587? or the Terminator Style: kill -9 3779 4587
    – djdomi
    Sep 19, 2021 at 14:51
  • neither works , I tried both , after I killed them , new nginx boot up again
    – Jia
    Sep 20, 2021 at 2:22

1 Answer 1

1

OpenResty (assumed you meant OpenResty and not OpenRusty!) is a toolset and an advanced configuration of nginx's http daemon. So it will always include a running nginx if openresty is running.

So for me your ps -aux | grep nginx results in:

...
root      8402  0.0  0.0  49984 14580 ?        SNs  Jul25   0:00 nginx: master process /usr/local/openresty/nginx/sbin/nginx -g daemon on; master_process on;
...

My config seems to include the full path, but if yours doesn't, you could try (replace 8402 with your nginx's pid):

sudo ls -l /proc/8402/exe

what, in my case, results in:

lrwxrwxrwx 1 root root 0 Sep 20 16:46 /proc/8402/exe -> /usr/local/openresty/nginx/sbin/nginx

So the running nginx binary comes from OpenResty and not the "other" nginx. You might also consider removing the other nginx to not getting confused about the correct config files...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .