2

My service has suddenly stopped working, systemctl status reports:

Main PID: 5459 (code=killed, signal=TERM)

Also, I checked through journald for my service (journalctl -u myservice.service) and the last entry is:

<...>
systemd[1]: Stopped MyService Service.

Does this mean it was manually stopped with systemctl stop or it might as well mean it has crashed? Is there a way to tell?

1 Answer 1

0

I have the same problem running on ubuntu 18.04 with rails 5.0.1 and ruby 2.3.3: starting my server from the command line or via systemd leads to the same output:

$ /usr/local/bin/ruby bin/rails server -b0.0.0.0 -p 3000 -e production
=> Booting Thin
=> Rails 5.0.1 application starting in production on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
[2022-06-21 12:55:32] INFO -- Thin web server (v1.8.1 codename Infinite Smoothie)
[2022-06-21 12:55:32] INFO -- Maximum connections set to 1024
[2022-06-21 12:55:32] INFO -- Listening on 0.0.0.0:3000, CTRL+C to stop
Exiting

I see this output in the console if I start the server from the console or in journalctl if I start it via systemd, while systemctl status reports Main PID: 19315 (code=killed, signal=TERM) as the OP notes.

Another odd observation is if I start the server from the command line with the -d (run as daemon) then it works as it should:

/usr/local/bin/rails server -b0.0.0.0 -p 3000 -e production -d

Works properly!

Nothing has changed in the systemd service file and there have been few significant changes in the server code itself. This could be an environment problem as I went through gem hell trying to provision the server. However, that doesn't really explain the -d thing.

4
  • Your answer is not answering OPs actual question: "Does this mean it was manually stopped with systemctl stop or it might as well mean it has crashed? Is there a way to tell?"
    – number9
    Commented Jun 30, 2022 at 13:30
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jun 30, 2022 at 13:30
  • @number9 - With all due respect, my post wasn't intended to answer OPs question. Like thousands of other responses to other questions, my post was intended to add more information to the failure mode scenario in the hopes that it might trigger a response by someone else who experienced a similar problem And, perhaps, could offer a solution.
    – djm
    Commented Jul 6, 2022 at 17:48
  • @Bot Your answer could be improved if it made even the slightest amount of cyber-sense. You can find more information on how to be a good robot in "I, Robot" - I. Asimov
    – djm
    Commented Jul 6, 2022 at 17:51

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .