0

I installed nginx(rh-nginx116-nginx) on Oracle Linux 7 docker image. After launching container, while starting of nginx service, getting following error:-

 [root@7b5b3ae7d392 /]# systemctl status rh-nginx116-nginx
● rh-nginx116-nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/rh-nginx116-nginx.service; disabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Sun 2020-10-04 13:19:09 UTC; 11min ago
  Process: 264 ExecStart=/opt/rh/rh-nginx116/root/usr/libexec/nginx-scl-helper enable $RH_NGINX116_SCLS_ENABLED -- /opt/rh/rh-nginx116/root/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 258 ExecStartPre=/opt/rh/rh-nginx116/root/usr/libexec/nginx-scl-helper enable $RH_NGINX116_SCLS_ENABLED -- /opt/rh/rh-nginx116/root/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 251 ExecStartPre=/opt/rh/rh-nginx116/root/usr/libexec/nginx-scl-helper enable $RH_NGINX116_SCLS_ENABLED -- /usr/bin/scl_enabled rh-nginx116 (code=exited, status=0/SUCCESS)
  Process: 250 ExecStartPre=/usr/bin/rm -f /var/opt/rh/rh-nginx116/run/nginx/nginx.pid (code=exited, status=0/SUCCESS)
   CGroup: /docker/7b5b3ae7d3922947203ceb8164bd1746c707b0851deb7283cf84f7642564eb54/system.slice/rh-nginx116-nginx.service
           ├─270 nginx: master process /opt/rh/rh-nginx116/root/usr/sbin/nginx
           ├─271 nginx: worker process
           └─272 nginx: worker process

Oct 04 13:17:39 7b5b3ae7d392 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Oct 04 13:17:39 7b5b3ae7d392 nginx-scl-helper[258]: nginx: the configuration file /etc/opt/rh/rh-nginx1... ok
Oct 04 13:17:39 7b5b3ae7d392 nginx-scl-helper[258]: nginx: configuration file /etc/opt/rh/rh-nginx116/n...ful
Oct 04 13:17:39 7b5b3ae7d392 systemd[1]: Refusing to accept PID outside of service control group, acqu....pid
Oct 04 13:17:39 7b5b3ae7d392 systemd[1]: Refusing to accept PID outside of service control group, acqu....pid
Oct 04 13:19:09 7b5b3ae7d392 systemd[1]: rh-nginx116-nginx.service start operation timed out. Terminating.
Oct 04 13:19:09 7b5b3ae7d392 systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Oct 04 13:19:09 7b5b3ae7d392 systemd[1]: Unit rh-nginx116-nginx.service entered failed state.
Oct 04 13:19:09 7b5b3ae7d392 systemd[1]: rh-nginx116-nginx.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

Nginx Systemd Unit file:-

[Unit]
Description=The nginx HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/var/opt/rh/rh-nginx116/run/nginx/nginx.pid
EnvironmentFile=/opt/rh/rh-nginx116/service-environment
# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
# SELinux context. This might happen when running `nginx -t` from the cmdline.
# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
ExecStartPre=/usr/bin/rm -f /var/opt/rh/rh-nginx116/run/nginx/nginx.pid
ExecStartPre=/opt/rh/rh-nginx116/root/usr/libexec/nginx-scl-helper enable $RH_NGINX116_SCLS_ENABLED -- /usr/bin/scl_enabled rh-nginx116
ExecStartPre=/opt/rh/rh-nginx116/root/usr/libexec/nginx-scl-helper enable $RH_NGINX116_SCLS_ENABLED -- /opt/rh/rh-nginx116/root/usr/sbin/nginx -t
ExecStart=/opt/rh/rh-nginx116/root/usr/libexec/nginx-scl-helper enable $RH_NGINX116_SCLS_ENABLED -- /opt/rh/rh-nginx116/root/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=process
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Please help me on this.

zcoder
  • 3
  • 1
developer
  • 1
  • 1

1 Answers1

0

I can see in your log file: Refusing to accept PID outside of service control group, acqu....pid

Check this link. As explained, systemd now enforces checking the PID defined in service units before allowing the service to start.

Your nginx service unit is probably not compatible with your systemd version. I suggest you to check that.

demathos
  • 16
  • 2