Nginx stop at the same time - cron daily

6 posts / 0 new
Last post
#1 Mon, 10/15/2018 - 08:10
Luiz Lopes

Nginx stop at the same time - cron daily

Hello,

Nginx stop every once in a while (usually weekly, but there is no fixed period) at the same time, 6:25 AM. At this same time (6:25 AM) there is scheduled a cron.daily

I´m using the latest virtualmin version with Ubuntu 18.04. Everything with the deafult packages.

Here is the var/log/syslog after 6:25 AM:

Oct 15 06:25:01 li4001 CRON[5412]: (root) CMD (/etc/webmin/status/monitor.pl)
Oct 15 06:25:01 li4001 CRON[5413]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 15 06:25:01 li4001 CRON[5414]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
Oct 15 06:25:09 li4001 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 15 06:25:09 li4001 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 15 06:25:09 li4001 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 15 06:25:09 li4001 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Oct 15 06:25:09 li4001 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 15 06:25:09 li4001 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 15 06:25:09 li4001 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 15 06:25:09 li4001 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 15 06:25:10 li4001 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Oct 15 06:25:10 li4001 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 15 06:25:10 li4001 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 15 06:25:10 li4001 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 15 06:25:10 li4001 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 15 06:25:10 li4001 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Oct 15 06:25:10 li4001 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 15 06:25:10 li4001 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 15 06:25:10 li4001 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 15 06:25:10 li4001 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 15 06:25:10 li4001 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Oct 15 06:25:10 li4001 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 15 06:25:10 li4001 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 15 06:25:10 li4001 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 15 06:25:10 li4001 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Oct 15 06:25:11 li4001 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 15 06:25:11 li4001 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 15 06:25:11 li4001 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Start request repeated too quickly.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Oct 15 06:25:11 li4001 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Start request repeated too quickly.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Oct 15 06:25:11 li4001 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Start request repeated too quickly.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Oct 15 06:25:11 li4001 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Start request repeated too quickly.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Oct 15 06:25:11 li4001 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Start request repeated too quickly.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Oct 15 06:25:11 li4001 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Oct 15 06:25:11 li4001 systemd[1]: Stopping LSB: Starts ProFTPD daemon...
Oct 15 06:25:11 li4001 proftpd[5733]:  * Stopping ftp server proftpd
Oct 15 06:25:11 li4001 proftpd[5733]:    ...done.
Oct 15 06:25:11 li4001 systemd[1]: Stopped LSB: Starts ProFTPD daemon.
Oct 15 06:25:11 li4001 systemd[1]: Starting LSB: Starts ProFTPD daemon...
Oct 15 06:25:11 li4001 proftpd[5744]:  * Starting ftp server proftpd
Oct 15 06:25:11 li4001 proftpd[5744]: 2018-10-15 06:25:11,706 li4001 proftpd[5762]: mod_dso/0.5: module 'mod_tls.c' already loaded
Oct 15 06:25:11 li4001 proftpd[5744]: 2018-10-15 06:25:11,711 li4001 proftpd[5762]: mod_dso/0.5: module 'mod_sftp.c' already loaded
Oct 15 06:25:11 li4001 proftpd[5744]: 2018-10-15 06:25:11,711 li4001 proftpd[5762]: warning: "li4001.*domain*.com" address/port (*ip*:21) already in use by "Debian"
Oct 15 06:25:11 li4001 proftpd[5744]:    ...done.
Oct 15 06:25:11 li4001 systemd[1]: Started LSB: Starts ProFTPD daemon.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Start request repeated too quickly.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Oct 15 06:25:11 li4001 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Start request repeated too quickly.
Oct 15 06:25:11 li4001 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Oct 15 06:25:11 li4001 systemd[1]: Failed to start A high performance web server and a reverse proxy server.

List of cron.daily:

/etc/cron.daily/quota
/etc/cron.daily/apport
/etc/cron.daily/man-db
/etc/cron.daily/logrotate
/etc/cron.daily/ubuntu-advantage-tools
/etc/cron.daily/mlocate
/etc/cron.daily/update-notifier-common
/etc/cron.daily/passwd
/etc/cron.daily/popularity-contest
/etc/cron.daily/mdadm
/etc/cron.daily/bsdmainutils
/etc/cron.daily/apt-compat
/etc/cron.daily/apt-show-versions
/etc/cron.daily/apache2
/etc/cron.daily/sysstat
/etc/cron.daily/webalizer
/etc/cron.daily/dpkg

I have 2 server with the same configuration and it happens in both - at the same time. Reading some other posts in this forum, some people suspect it is the logrotate.

Digging the logration, there is a log file with title "/var/log/apache2/*.log" with the post-rotation command:

if invoke-rc.d apache2 status > /dev/null 2>&1; then \
invoke-rc.d apache2 reload > /dev/null 2>&1; \
fi;

Please, I need help. And some direction. Thank you, Luiz

Mon, 10/15/2018 - 08:18
Luiz Lopes

Also, there is a post-rotation command "service nginx restart" for every domain I host. And there is 12 domain hosted on the server.

I think there is something related to the syslog message "nginx.service: Start request repeated too quickly."

Mon, 10/15/2018 - 08:42
Luiz Lopes

Not tested, but I think this thread answer my problem. https://www.virtualmin.com/node/40405

Sun, 10/28/2018 - 18:09
adamus007p

I have similar problem. Debain 9.5. Nginx Webmin version 1.894
Usermin version 1.741 Virtualmin version 6.04

I seems every week problem.

please have a look and see if you have I have similar problem.

please have a look and see if you have

Oct 28 06:25:12 host1 systemd[1]: Starting Daily apt upgrade and clean activities...
Oct 28 06:25:13 host1 systemd[1]: Started Daily apt upgrade and clean activities.

full logs:

ct 28 06:25:12 host1 systemd[1]: Starting Daily apt upgrade and clean activities...
Oct 28 06:25:13 host1 systemd[1]: Started Daily apt upgrade and clean activities.
Oct 28 06:25:13 host1 systemd[1]: apt-daily-upgrade.timer: Adding 58min 10.353002s random time.
Oct 28 06:25:13 host1 systemd[1]: apt-daily-upgrade.timer: Adding 39min 15.679272s random time.
Oct 28 06:25:16 host1 freshclam[651]: Sun Oct 28 06:25:16 2018 -> Received signal: re-opening log file
Oct 28 06:25:16 host1 freshclam[651]: Sun Oct 28 06:25:16 2018 -> ClamAV update process started at Sun Oct 28 06:25:16 2018
Oct 28 06:25:16 host1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 28 06:25:16 host1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 28 06:25:16 host1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 28 06:25:17 host1 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 28 06:25:18 host1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 28 06:25:18 host1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 28 06:25:18 host1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 28 06:25:18 host1 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 28 06:25:18 host1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 28 06:25:18 host1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 28 06:25:18 host1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 28 06:25:18 host1 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 28 06:25:19 host1 freshclam[651]: Sun Oct 28 06:25:19 2018 -> ^Your ClamAV installation is OUTDATED!
Oct 28 06:25:19 host1 freshclam[651]: Sun Oct 28 06:25:19 2018 -> ^Local version: 0.100.1 Recommended version: 0.100.2
Oct 28 06:25:19 host1 freshclam[651]: Sun Oct 28 06:25:19 2018 -> DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav
Oct 28 06:25:19 host1 freshclam[651]: Sun Oct 28 06:25:19 2018 -> main.cvd is up to date (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
Oct 28 06:25:19 host1 freshclam[651]: Sun Oct 28 06:25:19 2018 -> daily.cld is up to date (version: 25069, sigs: 2134628, f-level: 63, builder: raynman)
Oct 28 06:25:19 host1 freshclam[651]: Sun Oct 28 06:25:19 2018 -> bytecode.cld is up to date (version: 327, sigs: 91, f-level: 63, builder: neo)
Oct 28 06:25:21 host1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 28 06:25:21 host1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 28 06:25:21 host1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 28 06:25:21 host1 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 28 06:25:22 host1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 28 06:25:22 host1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 28 06:25:22 host1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 28 06:25:22 host1 systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
Oct 28 06:25:22 host1 systemd[1]: Started A high performance web server and a reverse proxy server.
Oct 28 06:25:23 host1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Oct 28 06:25:23 host1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Oct 28 06:25:23 host1 systemd[1]: nginx.service: Start request repeated too quickly.
Oct 28 06:25:23 host1 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Oct 28 06:25:23 host1 systemd[1]: nginx.service: Unit entered failed state.
Oct 28 06:25:23 host1 systemd[1]: nginx.service: Failed with result 'start-limit-hit'.
Oct 28 06:25:24 host1 systemd[1]: Stopping LSB: Starts ProFTPD daemon...
Oct 28 06:25:24 host1 proftpd[5988]: Stopping ftp server: proftpd.
Oct 28 06:25:24 host1 systemd[1]: Stopped LSB: Starts ProFTPD daemon.
Oct 28 06:25:24 host1 systemd[1]: Starting LSB: Starts ProFTPD daemon...

have you found a solution?

any other experienced webmin/virtualin users?

Sun, 10/28/2018 - 18:26
adamus007p

OK i have used

System Settings -> Server Templates -> Default Settings -> Log file rotation, is Yes in my config

I used following commands:

virtualmin disable-feature --logrotate --all-domains
virtualmin enable-feature --logrotate --all-domains
Mon, 10/29/2018 - 07:12
adamus007p

I can confirm that it solved a problem.

Topic locked