1

I have a centos server with 4Gb RAM. I'm doing a PHP console batch process that may take some hours... however it doesn't finish as the server shutdown after 1 or 2 hours from lauching the process... Here are the logs:

    Dec 28 04:39:01 www systemd[1]: Starting Clean php session files...
    Dec 28 04:39:02 www systemd[1]: Started Clean php session files.
    Dec 28 04:40:04 www systemd[1]: Stopped target Mail Transport Agent.
    Dec 28 04:40:04 www systemd[1]: Stopped target Timers.
    Dec 28 04:40:04 www systemd[1]: Stopping User Manager for UID 0...
    Dec 28 04:40:04 www systemd[1]: Stopping Session 12236053 of user root.
    Dec 28 04:40:04 www systemd[1]: Stopped Daily apt upgrade and clean activities.
    Dec 28 04:40:04 www systemd[24724]: Stopped target Default.
    Dec 28 04:40:04 www systemd[24724]: Stopped target Basic System.
    Dec 28 04:40:04 www systemd[24724]: Stopped target Sockets.
    Dec 28 04:40:04 www systemd[24724]: Reached target Shutdown.
    Dec 28 04:40:04 www systemd[24724]: Starting Exit the Session...
    Dec 28 04:40:04 www systemd[24724]: Stopped target Timers.
    Dec 28 04:40:04 www systemd[24724]: Stopped target Paths.
    Dec 28 04:40:04 www systemd[1]: Stopping Session 12226070 of user root.
    Dec 28 04:40:04 www systemd[1]: Stopped Run certbot twice daily.
    Dec 28 04:40:04 www systemd[1]: Stopped Daily apt download activities.
    Dec 28 04:40:04 www systemd[1]: Stopped Clean PHP session files every 30 mins.
    Dec 28 04:40:04 www systemd[1]: Stopped Daily Cleanup of Temporary Directories.
    Dec 28 04:40:04 www systemd[1]: Stopped target Graphical Interface.
    Dec 28 04:40:04 www systemd[1]: Stopped target Multi-User System.
    Dec 28 04:40:04 www systemd[1]: Stopped target Login Prompts.
    Dec 28 04:40:04 www systemd[1]: Stopping Console Getty...
    Dec 28 04:40:04 www systemd[1]: Stopping Getty on tty2...
    Dec 28 04:40:04 www systemd[1]: Stopping LSB: modules.dep creation....
    Dec 28 04:40:04 www systemd[1]: Stopping Unattended Upgrades Shutdown...
    Dec 28 04:40:04 www systemd[1]: Stopping OpenBSD Secure Shell server...
    Dec 28 04:40:04 www systemd[1]: Stopping LSB: Record successful boot for GRUB...
    Dec 28 04:40:04 www systemd[1]: Stopping LSB: Start/stop sysstat's sadc...
    Dec 28 04:40:04 www systemd[1]: Stopping A high performance web server and a reverse proxy server...
    Dec 28 04:40:04 www systemd[1]: Stopping Regular background program processing daemon...
    Dec 28 04:40:04 www systemd[1]: Stopping Runit service supervision...
    Dec 28 04:40:04 www systemd[1]: Stopping D-Bus System Message Bus...
    Dec 28 04:40:04 www systemd[24724]: Received SIGRTMIN+24 from PID 11820 (kill).
    Dec 28 04:40:04 www systemd[1]: Stopping LSB: Starts or stops the xinetd daemon....
    Dec 28 04:40:04 www systemd[1]: Stopping LSB: Postfix Mail Transport Agent...
    Dec 28 04:40:04 www systemd[1]: Stopping The PHP 7.0 FastCGI Process Manager...
    Dec 28 04:40:04 www systemd[1]: Stopping vsftpd FTP server...
    Dec 28 04:40:04 www rsyslogd: [origin software="rsyslogd" swVersion="8.20.0" x-pid="370" x-info="http://www.rsyslog.com"] exiting on signal 15.

It starts the clean php session files then suddently stops all services and shuts down!

My code seems ok....do I need to force cleaning the variables on code?

What is the problem?

Thanks

  • If the script is causing the shutdown, you may want to post the script so that others can troubleshoot. – JW8 Dec 28 '17 at 18:18
1

Your log shows that some process sent a signal to systemd causing it to shut down, and that the name of the process was kill.

Dec 28 04:40:04 www systemd[24724]: Received SIGRTMIN+24 from PID 11820 (kill).

It's most likely that a user did this manually, or that a script running on the system sent a signal to PID 1 (possibly by mistake, intending some other PID).

You may want to look into the two root user sessions that were open at the time of the shutdown.

  • I'm the only admin of the system, I was connected with 2 ssh, one with the script and the other with "top".... I did not kill any process... The shut down happens on every executation of that script – John Dec 28 '17 at 17:50
  • Then I would suggest studying that script very carefully. – Michael Hampton Dec 28 '17 at 19:27
  • I'd like to think that systemd did not start shutting the OS before reporting the reason why. – symcbean Dec 28 '17 at 21:54
0

You seem rather certain that the server shutdown is a consequence of running the script. If that is the case, then the script is shutting down the server. If you don't want the server to shutdown then change the script.

OTOH if its not the script which is at fault, then something else is happening. Increase your logging level.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.