• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Nginx start timeout

inigo

New Pleskian
I have been looking for this issue and tried all fixes that I found in this forum + internet and I could not fix the issue.

This is a brand new installed Plesk 12.5.30 Linux server on a clean Centos 7 proxmox container with over 30GB of disk space and 8GB Ram.

Installed plesk with the wget auto_install sh script from odin webpage, and it is running the demo Web Host license valid till April.

After restart, the website server is offline. Going to Tools and settings > Services, Proxy nginx is off.

1 When I click to start it: Error: Unable to make action: Unable to manage service by nginxmng: ('start', 'nginx'). Error: [2016-03-07 09:53:21] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx_control' '--start'] with exit code [255]
Can not start proxy server:

SOMETIMES, THE server starts and I can see the webpages, but the result in the panel is the same ERROR and the services page still shows nginx stopped with the start option.




2 In SSH, a /usr/local/psa/admin/bin/nginxmng --enable returns this:
[2016-03-07 09:53:21] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx_control' '--start'] with exit code [255]

Can not start proxy server:





3 If I run systemctl start nginx , returns this:
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: GDBus.Error:eek:rg.freedesktop.DBus.Error.TimedOut: Activation of org.freedesktop.PolicyKit1 timed out (g-dbus-error-quark, 20)

Failed to start nginx.service: Connection timed out





4 The systemctl status nginx shows:
PID file /run/nginx.pid not readable (yet?) after start.
Mar 07 09:53:20 myhost.com systemd[1]: nginx.service start operation timed out. Terminating.
Mar 07 09:53:21 myhost.com systemd[1]: Failed to start Startup script for nginx service.


I can confirm that the file /run/nginx.pid does not exist.




5 For debug purposes, I disabled SELinux:

[root@www run]# sestatus
SELinux status: disabled






6 Desperate, as suggested by Igor in another post, I ran the plesk repair web tool with this 2 errors as result:

Repair server-wide configuration parameters for web servers? [Y/n] y

Repairing server-wide configuration parameters for web servers .. [2016-03-07 09:33:33] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/httpdmng' '--reconfigure-server'] with exit code [1]
[FAILED]
- httpdmng failed: [2016-03-07 09:33:30] ERR [util_exec]
proc_close() failed ['/usr/local/psa/admin/bin/nginx_control'
'--restart'] with exit code [255]
Can not reload proxy server:


Repair web server configuration for all domains? [Y/n] y

Repairing web server configuration for all domains .............. [2016-03-07 09:36:26] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/httpdmng' '--reconfigure-all'] with exit code [1]

Error occured while sending feedback. HTTP code returned: 502
[FAILED]
- httpdmng failed: Error occured while sending feedback. HTTP
code returned: 502
Error occured while sending feedback. HTTP code returned: 502
Execution failed.
Command: httpdmng







ANY HELP IS VERY APPRECIATED, I RECREATED THIS VIRTUAL MACHINE 3 TIMES, and THE SAME RESULTS ALL THE TIMES.
 
Last edited:
Hi,

its not a plesk bug, its systemd...

You must edit the "UNIT" section to:

[Unit]
Description=Startup script for nginx service
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

in "/usr/lib/systemd/system/nginx.service".

Attached my full file:

[Unit]
Description=Startup script for nginx service
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
EnvironmentFile=-/etc/sysconfig/nginx

.include /etc/sysconfig/nginx.systemd
# tuning of limits settings:
# 1. fill required limits as described in systemd.exec(5)
# nginx.systemd content example for number of open files:
# [Service]
# LimitNOFILE=8192
# 2. restart service

ExecStartPre=/usr/bin/test $NGINX_ENABLED = "yes"
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx

ExecReload=/usr/bin/test $NGINX_ENABLED = "yes"
ExecReload=/usr/sbin/nginx -t
ExecReload=/bin/kill -s HUP $MAINPID

ExecStop=/bin/kill -s QUIT $MAINPID

[Install]
WantedBy=multi-user.target
 
Hi,

its not a plesk bug, its systemd...

You must edit the "UNIT" section to:

[Unit]
Description=Startup script for nginx service
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

in "/usr/lib/systemd/system/nginx.service".

Attached my full file:

[Unit]
Description=Startup script for nginx service
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
EnvironmentFile=-/etc/sysconfig/nginx

.include /etc/sysconfig/nginx.systemd
# tuning of limits settings:
# 1. fill required limits as described in systemd.exec(5)
# nginx.systemd content example for number of open files:
# [Service]
# LimitNOFILE=8192
# 2. restart service

ExecStartPre=/usr/bin/test $NGINX_ENABLED = "yes"
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx

ExecReload=/usr/bin/test $NGINX_ENABLED = "yes"
ExecReload=/usr/sbin/nginx -t
ExecReload=/bin/kill -s HUP $MAINPID

ExecStop=/bin/kill -s QUIT $MAINPID

[Install]
WantedBy=multi-user.target


Hi Erik

Your method not run in my server. Can you see my nginx status and help me??

[root@server ~]# systemctl status nginx
● nginx.service - Startup script for nginx service
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since lun 2016-06-06 15:09:00 CEST; 2s ago
Process: 2187 ExecStartPre=/usr/bin/test $NGINX_ENABLED = yes (code=exited, status=2)

jun 06 15:08:59 server systemd[1]: Starting Startup script for nginx service...
jun 06 15:08:59 server test[2187]: /usr/bin/test: missing argument after 'yes'
jun 06 15:09:00 server systemd[1]: nginx.service: control process exited, code=exited status=2
jun 06 15:09:00 server systemd[1]: Failed to kill control group: Invalid argument
jun 06 15:09:00 server systemd[1]: Failed to kill control group: Invalid argument
jun 06 15:09:00 server systemd[1]: Failed to start Startup script for nginx service.
jun 06 15:09:00 server systemd[1]: Unit nginx.service entered failed state.
jun 06 15:09:00 server systemd[1]: nginx.service failed.

Thanks!
 
Ok, I've solved my problem.

This problem whit /usr/bin/test is because it's not possible start/stop a process from panel and start/stop from console at the same time. If the process start from panel, should stop from panel.

Thanks for all!
 
Back
Top