Welcome! Log In Create A New Profile

Advanced

systemd nginx service unable to start nginx 1.11.10

Vincent Li
May 28, 2019 06:42PM
Hi,

I am running ubuntu 16.04, the nginx package from ubuntu can be
started from systemd ok as below shown.

======COMMAND OUTPUT=====
#/usr/sbin/nginx-from-ubuntu -v

nginx version: nginx/1.10.3 (Ubuntu)

# ls -l /usr/sbin/nginx

lrwxrwxrwx 1 root root 27 May 28 15:29 /usr/sbin/nginx ->
/usr/sbin/nginx-from-ubuntu

# cat /lib/systemd/system/nginx.service


[Unit]

Description=The NGINX HTTP and reverse proxy server

After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]

Type=forking

PIDFile=/run/nginx.pid

ExecStartPre=/usr/sbin/nginx -t

ExecStart=/usr/sbin/nginx

ExecReload=/usr/sbin/nginx -s reload

ExecStop=/bin/kill -s QUIT $MAINPID

PrivateTmp=true


[Install]

WantedBy=multi-user.target

# systemctl start nginx

# systemctl status nginx

● nginx.service - The NGINX HTTP and reverse proxy server

Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor
preset: enabled)

Active: active (running) since Tue 2019-05-28 15:29:25 PDT; 5s ago

==========OUTPUT END=====

but if I download the nginx 1.11.10 source tar ball from nginx
download site and compile and run the nginx 1.11.10 binary, systemd
unable to start it, systemctl hanging there and eventually failed

=========COMMAND OUTPUT======

# /usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.11.10

#rm -rf /usr/sbin/nginx

# ln -s /usr/local/nginx/sbin/nginx /usr/sbin/nginx

# systemctl start nginx

Job for nginx.service failed because a timeout was exceeded. See
"systemctl status nginx.service" and "journalctl -xe" for details.

-- Unit nginx.service has begun starting up.

May 28 15:36:47 controller-dell710 nginx[12643]: nginx: the
configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

May 28 15:36:47 controller-dell710 nginx[12643]: nginx: configuration
file /usr/local/nginx/conf/nginx.conf test is successful

May 28 15:36:47 controller-dell710 systemd[1]: nginx.service: PID file
/run/nginx.pid not readable (yet?) after start: No such file or
directory

May 28 15:38:17 controller-dell710 systemd[1]: nginx.service: Start
operation timed out. Terminating.

May 28 15:38:17 controller-dell710 systemd[1]: Failed to start The
NGINX HTTP and reverse proxy server.

-- Subject: Unit nginx.service has failed

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unit nginx.service has failed.

--

-- The result is failed.

May 28 15:38:17 controller-dell710 systemd[1]: nginx.service: Unit
entered failed state.

May 28 15:38:17 controller-dell710 systemd[1]: nginx.service: Failed
with result 'timeout'.

=======OUTPUT END======
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

systemd nginx service unable to start nginx 1.11.10

Vincent Li May 28, 2019 06:42PM

Re: systemd nginx service unable to start nginx 1.11.10

Maxim Dounin May 28, 2019 07:46PM

Re: systemd nginx service unable to start nginx 1.11.10

Vincent Li May 28, 2019 08:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready