[Bug 1839290] Re: systemd doesn't restart a service after crashes

Vladimir Kononov voldemark at gmail.com
Thu Feb 13 08:24:07 UTC 2020


Thank you, Dan. 
The PPA build indeed fixes the test case in #8, for Xenial at the very least. Sending SIGABRT to foo.service's process now causes services to restart, just as intended. Here are the logs from the very same Xenial machine, as in #8:

$ sudo apt install systemd=229-4ubuntu21.28~next20200212b2
<...>
$ sudo systemctl daemon-reexec 
$ sudo systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: active (running) since Thu 2020-02-13 11:04:06 MSK; 5min ago
 Main PID: 4753 (sleep)
   CGroup: /system.slice/foo.service
           └─4753 /bin/sleep infinity

Feb 13 11:04:06 pono-mac systemd[1]: Started foo.service.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: active (running) since Thu 2020-02-13 11:04:06 MSK; 5min ago
 Main PID: 4759 (sleep)
   CGroup: /system.slice/bar.service
           └─4759 /bin/sleep infinity

Feb 13 11:04:06 pono-mac systemd[1]: Started bar.service.

$ sudo kill -6 4753
$ sudo systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: active (running) since Thu 2020-02-13 11:12:05 MSK; 2s ago
 Main PID: 11122 (sleep)
    Tasks: 1
   Memory: 200.0K
      CPU: 1ms
   CGroup: /system.slice/foo.service
           └─11122 /bin/sleep infinity

Feb 13 11:12:05 pono-mac systemd[1]: Stopped foo.service.
Feb 13 11:12:05 pono-mac systemd[1]: Started foo.service.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: active (running) since Thu 2020-02-13 11:12:05 MSK; 2s ago
 Main PID: 11123 (sleep)
    Tasks: 1
   Memory: 224.0K
      CPU: 1ms
   CGroup: /system.slice/bar.service
           └─11123 /bin/sleep infinity

Feb 13 11:12:05 pono-mac systemd[1]: Started bar.service.


I'll test it with Bionic in a few hours.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1839290

Title:
  systemd doesn't restart a service after crashes

Status in systemd:
  Fix Released
Status in systemd package in Ubuntu:
  Fix Released
Status in systemd source package in Xenial:
  In Progress
Status in systemd source package in Bionic:
  In Progress
Status in systemd source package in Disco:
  Fix Released

Bug description:
  [impact]

  when a service configured to restart crashes, under certain
  configurations, that service is not correctly restarted.

  [test case]

  see comment 8

  [regression potential]

  this changes the job mode of manager-triggered restarts to 'replace'
  any existing queued job(s), instead of failing if there are queued
  job(s).  thus any regressions would occur when a service fails, that
  is configured to restart on failure.

  [scope]

  This is needed only for Xenial and Bionic.

  this is fixed with commit 03ff2dc71ecb09272d728d458498b44f7f132f51
  which is included already in Eoan.

  [other info]

  original description:
  ---

  Affected versions of OS and systemd:
  $ cat /etc/issue
  Ubuntu 16.04.6 LTS \n \l
  $ systemd --version
  systemd 229
  +PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN

  Affected packages:
  systemd 229-4ubuntu21.22 and previous versions.

  Expected behaviour you didn't see:
  Scheduling restart of failed service.
  A process crashed by sigabrt and didn't restart.

  Description:
  The bug was reported to a systemd upstream repository: https://github.com/systemd/systemd/issues/11456
  The bug was fixed and accepted to the master branch: https://github.com/systemd/systemd/pull/11467/files

  Action:
  Include this patch to Ubuntu 16.04 and other version of Ubuntu which are supported.

To manage notifications about this bug go to:
https://bugs.launchpad.net/systemd/+bug/1839290/+subscriptions



More information about the foundations-bugs mailing list