systemd doesn't restart a service after crashes

Bug #1839290 reported by Eugene Kilimchuk
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
systemd
Fix Released
Unknown
systemd (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
Fix Released
Medium
Dan Streetman
Bionic
Fix Released
Medium
Dan Streetman
Disco
Fix Released
Medium
Unassigned

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.

Fixed in Disco with the backported v240 patch from
https://github.com/systemd/systemd/commit/677b4cc753f183731fc54fcb68ad46f806c394bc

[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.

tags: added: systemd
affects: launchpad → systemd (Ubuntu)
summary: - systemd dosn't restart a service after crashes
+ systemd doesn't restart a service after crashes
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Vladimir Kononov (voldemark) wrote :

Hello, everyone.

Here's a debdiff patch with a backport of upstream patch to xenial branch of systemd.

I've successfully built a modified source and deployed it to some xenial machines — it works as intended, failed service restart correctly, just as intended by Restart=always policy.

Before:
systemd[1]: vpp.service: Main process exited, code=dumped, status=6/ABRT
systemd[1]: Stopped vector packet processing engine.
systemd[1]: vpp.service: Unit entered failed state.
systemd[1]: vpp.service: Failed with result 'core-dump'.
systemd[1]: vpp.service: Service hold-off time over, scheduling restart.
systemd[1]: vpp.service: Failed to schedule restart job: Transaction is destructive.
systemd[1]: vpp.service: Unit entered failed state.
systemd[1]: vpp.service: Failed with result 'resources'.

After:
systemd[1]: vpp.service: Main process exited, code=dumped, status=6/ABRT
systemd[1]: Stopped vector packet processing engine.
systemd[1]: vpp.service: Unit entered failed state.
systemd[1]: vpp.service: Failed with result 'core-dump'.
systemd[1]: vpp.service: Service hold-off time over, scheduling restart.
systemd[1]: Stopped vector packet processing engine.
systemd[1]: Starting vector packet processing engine...

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "debdiff for xenial systemd branch" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
tags: added: rls-xx-incoming
Revision history for this message
Mathew Hodson (mhodson) wrote :

Fix is in v241 and later upstream

Changed in systemd (Ubuntu):
status: Confirmed → Fix Committed
Mathew Hodson (mhodson)
Changed in systemd (Ubuntu):
importance: Undecided → Medium
Changed in systemd (Ubuntu Xenial):
importance: Undecided → Medium
Changed in systemd (Ubuntu Bionic):
importance: Undecided → Medium
tags: added: rls-x-incoming
removed: rls-xx-incoming
Dan Streetman (ddstreet)
Changed in systemd (Ubuntu Disco):
status: New → Fix Released
Dan Streetman (ddstreet)
tags: added: next-ddstreet
Dan Streetman (ddstreet)
tags: added: bionic ddstreet xenial
removed: next-ddstreet
Mathew Hodson (mhodson)
Changed in systemd (Ubuntu):
status: Fix Committed → Fix Released
Changed in systemd:
status: Unknown → Fix Released
Revision history for this message
Mathew Hodson (mhodson) wrote :

Disco is currently marked Fix Released. Which version of the Ubuntu package was it fixed in?

Revision history for this message
Vladimir Kononov (voldemark) wrote :

Mathew, I've just checked the ubuntu-disco branch of systemd — it looks like fix was backported in systemd=240-6ubuntu5 with a bunch of other fixes, see debian/patches/Change-job-mode-of-manager-triggered-restarts-to-JOB_REPL.patch. So disco was fixed before this bug was actually filed.

Xenial and Bionic are still affected — any chance of a bugfix landing there?

Revision history for this message
Dan Streetman (ddstreet) wrote :

@voldemark, the testcase given in https://github.com/systemd/systemd/issues/11456 doesn't appear to be fixed in disco. Do you have an example testcase of your specific problem that is fixed by the patch from https://github.com/systemd/systemd/pull/11467

Dan Streetman (ddstreet)
tags: removed: bionic ddstreet systemd xenial
Changed in systemd (Ubuntu Disco):
status: Fix Released → Incomplete
Changed in systemd (Ubuntu Bionic):
status: New → Incomplete
Changed in systemd (Ubuntu Xenial):
status: New → Incomplete
Changed in systemd (Ubuntu Disco):
importance: Undecided → Medium
Revision history for this message
Vladimir Kononov (voldemark) wrote :

Here is a minimal example, courtesy of bl33pbl0p from the github issue. I've double-checked it and it is valid test case for this issue:

$ systemctl cat foo
# /etc/systemd/system/foo.service
[Unit]
PartOf=bar.service
[Service]
ExecStart=/bin/sleep infinity
RestartSec=0s
Restart=always

$ systemctl cat bar
# /etc/systemd/system/bar.service
[Unit]
BindsTo=foo.service
#Same with or without After=, the window is very small to make a difference.
After=foo.service
[Service]
ExecStart=/bin/sleep infinity

$ sudo systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2020-02-12 11:38:30 MSK; 36s ago
 Main PID: 1614 (sleep)
    Tasks: 1
   Memory: 172.0K
      CPU: 1ms
   CGroup: /system.slice/foo.service
           └─1614 /bin/sleep infinity

Feb 12 11:38:30 pono-mac systemd[1]: Started foo.service.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2020-02-12 11:38:30 MSK; 36s ago
 Main PID: 1625 (sleep)
    Tasks: 1
   Memory: 188.0K
      CPU: 972us
   CGroup: /system.slice/bar.service
           └─1625 /bin/sleep infinity

Feb 12 11:38:30 pono-mac systemd[1]: Started bar.service.

$ sudo kill -6 1614
$ sudo systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: failed (Result: resources) since Wed 2020-02-12 11:39:24 MSK; 2s ago
  Process: 1614 ExecStart=/bin/sleep infinity (code=killed, signal=ABRT)
 Main PID: 1614 (code=killed, signal=ABRT)

Feb 12 11:39:24 pono-mac systemd[1]: foo.service: Unit entered failed state.
Feb 12 11:39:24 pono-mac systemd[1]: foo.service: Failed with result 'signal'.
Feb 12 11:39:24 pono-mac systemd[1]: foo.service: Service has no hold-off time, scheduling restart.
Feb 12 11:39:24 pono-mac systemd[1]: foo.service: Failed to schedule restart job: Transaction is destructive.
Feb 12 11:39:24 pono-mac systemd[1]: foo.service: Unit entered failed state.
Feb 12 11:39:24 pono-mac systemd[1]: foo.service: Failed with result 'resources'.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: inactive (dead) since Wed 2020-02-12 11:39:24 MSK; 2s ago
  Process: 1625 ExecStart=/bin/sleep infinity (code=killed, signal=TERM)
 Main PID: 1625 (code=killed, signal=TERM)

Feb 12 11:38:30 pono-mac systemd[1]: Started bar.service.
Feb 12 11:39:24 pono-mac systemd[1]: Stopping bar.service...
Feb 12 11:39:24 pono-mac systemd[1]: Stopped bar.service.

Revision history for this message
Dan Streetman (ddstreet) wrote :

@voldemark, very sorry it seems when I made comment 7 I must have missed your comment 6, so I was unclear on why this was marked as affecting Disco.

I've reproduced and will queue the patch for Bionic.

Changed in systemd (Ubuntu Disco):
status: Incomplete → Fix Released
Changed in systemd (Ubuntu Bionic):
assignee: nobody → Dan Streetman (ddstreet)
Changed in systemd (Ubuntu Xenial):
assignee: nobody → Dan Streetman (ddstreet)
status: Incomplete → In Progress
Changed in systemd (Ubuntu Bionic):
status: Incomplete → In Progress
description: updated
Dan Streetman (ddstreet)
description: updated
Revision history for this message
Dan Streetman (ddstreet) wrote :

@voldemark can you test with the systemd for Xenial and/or Bionic from this ppa to make sure it's working for you:

https://launchpad.net/~ddstreet/+archive/ubuntu/systemd

Revision history for this message
Vladimir Kononov (voldemark) wrote :

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.

Revision history for this message
Vladimir Kononov (voldemark) wrote :
Download full text (4.4 KiB)

For Bionic the problem also seems to fixed in systemd=237-3ubuntu10.40~next20200212b1
foo and bar service files are exactly the same as in #8

Restart fails with systemd=237-3ubuntu10.38:
pono@systemd-bionic-test:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"
pono@systemd-bionic-test:~$ dpkg -l systemd | tail -n 1
ii systemd 237-3ubuntu10.38 amd64 system and service manager

pono@systemd-bionic-test:~$ sudo systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: active (running) since Mon 2020-02-17 08:29:49 UTC; 7s ago
 Main PID: 11403 (sleep)
    Tasks: 1 (limit: 1129)
   CGroup: /system.slice/foo.service
           └─11403 /bin/sleep infinity

Feb 17 08:29:49 systemd-bionic-test systemd[1]: Started foo.service.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: active (running) since Mon 2020-02-17 08:29:49 UTC; 7s ago
 Main PID: 11404 (sleep)
    Tasks: 1 (limit: 1129)
   CGroup: /system.slice/bar.service
           └─11404 /bin/sleep infinity

Feb 17 08:29:49 systemd-bionic-test systemd[1]: Started bar.service.
pono@systemd-bionic-test:~$ sudo kill -6 11403
pono@systemd-bionic-test:~$ sudo systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: failed (Result: signal) since Mon 2020-02-17 08:30:23 UTC; 3s ago
  Process: 11403 ExecStart=/bin/sleep infinity (code=killed, signal=ABRT)
 Main PID: 11403 (code=killed, signal=ABRT)

Feb 17 08:30:23 systemd-bionic-test systemd[1]: foo.service: Main process exited, code=killed, status=6/ABRT
Feb 17 08:30:23 systemd-bionic-test systemd[1]: foo.service: Failed with result 'signal'.
Feb 17 08:30:23 systemd-bionic-test systemd[1]: foo.service: Service has no hold-off time, scheduling restart.
Feb 17 08:30:23 systemd-bionic-test systemd[1]: foo.service: Failed to schedule restart job: Transaction is destructive.
Feb 17 08:30:23 systemd-bionic-test systemd[1]: foo.service: Failed with result 'signal'.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: inactive (dead) since Mon 2020-02-17 08:30:23 UTC; 3s ago
  Process: 11404 ExecStart=/bin/sleep infinity (code=killed, signal=TERM)
 Main PID: 11404 (code=killed, signal=TERM)

Feb 17 08:29:49 systemd-bionic-test systemd[1]: Started bar.service.
Feb 17 08:30:23 systemd-bionic-test systemd[1]: Stopping bar.service...
Feb 17 08:30:23 systemd-bionic-test systemd[1]: Stopped bar.service.

Restart works fine with 237-3ubuntu10.40~next20200212b1:
pono@systemd-bionic-test:~$ sudo apt install systemd=237-3ubuntu10.40~next20200212b1
<...>
pono@systemd-bionic-test:~$ sudo systemctl daemon-reexec
pono@systemd-bionic-test:~$ sudo systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: active (running) since Mon 2020-02-17 08:31:41 UTC; 11min ago
 Main PID: 11752 (sleep)
    Tasks: 1 (limit: 1129)
   CGroup: /system.slice/...

Read more...

Revision history for this message
Vladimir Kononov (voldemark) wrote :

Dan, is there any chance of this fix landing to xenial-proposed and bionic-proposed?
Thanks.

Revision history for this message
Dan Streetman (ddstreet) wrote :

> Dan, is there any chance of this fix landing to xenial-proposed and bionic-proposed?

this is in my queue and i'm planning to gather patches for some other systemd bugs in my list starting next week.

https://code.launchpad.net/~ubuntu-support-team/ubuntu/+source/systemd/+git/systemd/+ref/next-x
https://code.launchpad.net/~ubuntu-support-team/ubuntu/+source/systemd/+git/systemd/+ref/next-b

Revision history for this message
Vladimir Kononov (voldemark) wrote :

Thank you, Dan, that is great news.

Mathew Hodson (mhodson)
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Eugene, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.40 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/237-3ubuntu10.40)

All autopkgtests for the newly accepted systemd (237-3ubuntu10.40) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

gvfs/1.36.1-0ubuntu1.3.3 (amd64)
prometheus-postgres-exporter/unknown (armhf)
systemd/237-3ubuntu10.40 (i386, ppc64el)
umockdev/0.11.1-1 (armhf)
linux-hwe-5.0/5.0.0-47.51~18.04.1 (armhf)
kde4libs/4:4.14.38-0ubuntu3.1 (armhf)
util-linux/unknown (armhf)
nftables/unknown (armhf)
linux-raspi2-5.3/5.3.0-1023.25~18.04.1 (armhf)
netplan.io/0.98-0ubuntu1~18.04.1 (i386)
openssh/1:7.6p1-4ubuntu0.3 (arm64, i386, armhf, ppc64el, s390x, amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Eugene, or anyone else affected,

Accepted systemd into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/229-4ubuntu21.28 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/229-4ubuntu21.28)

All autopkgtests for the newly accepted systemd (229-4ubuntu21.28) for xenial have finished running.
The following regressions have been reported in tests triggered by the package:

udisks2/2.1.7-1ubuntu1 (amd64)
multipath-tools/0.5.0+git1.656f8865-5ubuntu2.5 (armhf)
nplan/0.32~16.04.7 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/xenial/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Dan Streetman (ddstreet) wrote :
Download full text (5.3 KiB)

bionic:

ubuntu@lp1839290-b:~$ dpkg -l systemd|grep systemd
ii systemd 237-3ubuntu10.39 amd64 system and service manager
ubuntu@lp1839290-b:~$ systemctl cat foo
# /etc/systemd/system/foo.service
[Unit]
PartOf=bar.service
[Service]
ExecStart=/bin/sleep infinity
RestartSec=0s
Restart=always

ubuntu@lp1839290-b:~$ systemctl cat bar
# /etc/systemd/system/bar.service
[Unit]
BindsTo=foo.service
#Same with or without After=, the window is very small to make a difference.
After=foo.service
[Service]
ExecStart=/bin/sleep infinity

ubuntu@lp1839290-b:~$ sudo systemctl start foo
ubuntu@lp1839290-b:~$ sudo systemctl start bar
ubuntu@lp1839290-b:~$ systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2020-05-06 11:20:31 UTC; 4s ago
 Main PID: 8560 (sleep)
    Tasks: 1 (limit: 4702)
   CGroup: /system.slice/foo.service
           └─8560 /bin/sleep infinity

May 06 11:20:31 lp1839290-b systemd[1]: Started foo.service.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2020-05-06 11:20:33 UTC; 3s ago
 Main PID: 8570 (sleep)
    Tasks: 1 (limit: 4702)
   CGroup: /system.slice/bar.service
           └─8570 /bin/sleep infinity

May 06 11:20:33 lp1839290-b systemd[1]: Started bar.service.

ubuntu@lp1839290-b:~$ sudo kill -6 8560
ubuntu@lp1839290-b:~$ systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: failed (Result: core-dump) since Wed 2020-05-06 11:21:08 UTC; 1s ago
  Process: 8560 ExecStart=/bin/sleep infinity (code=dumped, signal=ABRT)
 Main PID: 8560 (code=dumped, signal=ABRT)

May 06 11:21:08 lp1839290-b systemd[1]: foo.service: Service has no hold-off time, scheduling restart.
May 06 11:21:08 lp1839290-b systemd[1]: foo.service: Failed to schedule restart job: Transaction is destructive.
May 06 11:21:08 lp1839290-b systemd[1]: foo.service: Failed with result 'core-dump'.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: inactive (dead) since Wed 2020-05-06 11:21:08 UTC; 1s ago
  Process: 8570 ExecStart=/bin/sleep infinity (code=killed, signal=TERM)
 Main PID: 8570 (code=killed, signal=TERM)

May 06 11:20:33 lp1839290-b systemd[1]: Started bar.service.
May 06 11:21:08 lp1839290-b systemd[1]: Stopping bar.service...
May 06 11:21:08 lp1839290-b systemd[1]: Stopped bar.service.

ubuntu@lp1839290-b:~$ dpkg -l systemd|grep systemd
ii systemd 237-3ubuntu10.40 amd64 system and service manager
ubuntu@lp1839290-b:~$ sudo systemctl start bar
ubuntu@lp1839290-b:~$ sudo systemctl start foo
ubuntu@lp1839290-b:~$ sudo systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2020-05-06 11:24:57 UTC; 10s ago
 Main PID: 1256 (sleep)
    Tasks: 1 (limit: 4702)
   CGroup: /system.slice/foo.service
           └─1256 /bin/sleep infinity

May 06 11:24:57 lp1839290-b systemd[1]: Started foo.service.

● bar.serv...

Read more...

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Dan Streetman (ddstreet) wrote :
Download full text (5.7 KiB)

xenial:

ubuntu@lp1839290-x:~$ dpkg -l systemd|grep systemd
ii systemd 229-4ubuntu21.27 amd64 system and service manager
ubuntu@lp1839290-x:~$ systemctl cat foo
# /etc/systemd/system/foo.service
# /etc/systemd/system/foo.service
[Unit]
PartOf=bar.service
[Service]
ExecStart=/bin/sleep infinity
RestartSec=0s
Restart=always

ubuntu@lp1839290-x:~$ systemctl cat bar
# /etc/systemd/system/bar.service
# /etc/systemd/system/bar.service
[Unit]
BindsTo=foo.service
#Same with or without After=, the window is very small to make a difference.
After=foo.service
[Service]
ExecStart=/bin/sleep infinity

ubuntu@lp1839290-x:~$ sudo systemctl start foo
ubuntu@lp1839290-x:~$ sudo systemctl start bar
ubuntu@lp1839290-x:~$ systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2020-05-06 11:28:14 UTC; 5s ago
 Main PID: 1268 (sleep)
    Tasks: 1
   Memory: 80.0K
      CPU: 1ms
   CGroup: /system.slice/foo.service
           └─1268 /bin/sleep infinity

May 06 11:28:14 lp1839290-x systemd[1]: Started foo.service.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2020-05-06 11:28:17 UTC; 3s ago
 Main PID: 1273 (sleep)
    Tasks: 1
   Memory: 84.0K
      CPU: 1ms
   CGroup: /system.slice/bar.service
           └─1273 /bin/sleep infinity

May 06 11:28:17 lp1839290-x systemd[1]: Started bar.service.
ubuntu@lp1839290-x:~$ sudo kill -6 1268
ubuntu@lp1839290-x:~$ systemctl status foo bar
● foo.service
   Loaded: loaded (/etc/systemd/system/foo.service; static; vendor preset: enabled)
   Active: failed (Result: resources) since Wed 2020-05-06 11:28:29 UTC; 929ms ago
  Process: 1268 ExecStart=/bin/sleep infinity (code=dumped, signal=ABRT)
 Main PID: 1268 (code=dumped, signal=ABRT)

May 06 11:28:29 lp1839290-x systemd[1]: foo.service: Unit entered failed state.
May 06 11:28:29 lp1839290-x systemd[1]: foo.service: Failed with result 'core-dump'.
May 06 11:28:29 lp1839290-x systemd[1]: foo.service: Service has no hold-off time, scheduling restart.
May 06 11:28:29 lp1839290-x systemd[1]: foo.service: Failed to schedule restart job: Transaction is destructive.
May 06 11:28:29 lp1839290-x systemd[1]: foo.service: Unit entered failed state.
May 06 11:28:29 lp1839290-x systemd[1]: foo.service: Failed with result 'resources'.

● bar.service
   Loaded: loaded (/etc/systemd/system/bar.service; static; vendor preset: enabled)
   Active: inactive (dead) since Wed 2020-05-06 11:28:29 UTC; 931ms ago
  Process: 1273 ExecStart=/bin/sleep infinity (code=killed, signal=TERM)
 Main PID: 1273 (code=killed, signal=TERM)

May 06 11:28:17 lp1839290-x systemd[1]: Started bar.service.
May 06 11:28:29 lp1839290-x systemd[1]: Stopping bar.service...
May 06 11:28:29 lp1839290-x systemd[1]: Stopped bar.service.

ubuntu@lp1839290-x:~$ dpkg -l systemd|grep systemd
ii systemd 229-4ubuntu21.28 amd64 system and service manager
ubuntu@lp1839290-x:~$ sudo systemctl start foo
ubuntu@lp1839290-x:~$ sudo systemctl start bar
ubuntu@lp1839290-x:~$ systemctl status foo bar
● foo.service
   Loa...

Read more...

tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 237-3ubuntu10.40

---------------
systemd (237-3ubuntu10.40) bionic; urgency=medium

  * d/t/logind: skip if nonexistent /sys/power/state (LP: #1862657)
  * d/p/lp1839290-Change-job-mode-of-manager-triggered-restarts-to-JOB.patch:
    - when restarting service after failure, replace existing queued jobs
      (LP: #1839290)
  * d/p/lp1867421-70-mouse.hwdb-Set-DPI-for-MS-Classic-IntelliMouse.patch:
    - fix resolution of IntelliMouse (LP: #1867421)
  * d/p/lp1858412-journalctl-allow-running-vacuum-on-remote-journals-t.patch:
    - allow vacuuming journal 'root' dir (LP: #1858412)
  * d/p/lp1862232/0001-network-add-more-log-messages-in-configuring-DHCP4-c.patch,
    d/p/lp1862232/0002-network-add-more-log-messages-in-configuring-DHCP6-c.patch,
    d/p/lp1862232/0003-network-also-check-that-Hostname-is-a-valid-DNS-doma.patch,
    d/p/lp1862232/0004-network-use-free_and_replace.patch,
    d/p/lp1862232/0005-network-DHCP-ignore-error-in-setting-hostname-when-i.patch,
    d/p/lp1862232/0006-man-mention-that-Hostname-for-DHCP-must-be-a-valid-D.patch,
    d/p/lp1862232/0007-resolve-fix-error-handling-of-dns_name_is_valid.patch:
    - do not fail network setup if hostname is not valid (LP: #1862232)
  * d/t/systemd-fsckd: Skip test on arm64 (LP: #1870194)
  * d/p/lp1870589-seccomp-rework-how-the-S-UG-ID-filter-is-installed.patch:
    - fix test-seccomp failure (LP: #1870589)
  * d/rules: use meson --print-errorlogs instead of cat testlog
    - (LP: #1870811)
  * d/p/lp1776654-test-Synchronize-journal-before-reading-from-it.patch:
    - sync journal before reading from it (LP: #1776654)
  * d/p/lp1837914-journal-do-not-trigger-assertion-when-journal_file_c.patch:
    - do not crash if NULL passted to journal destructor (LP: #1837914)
  * d/e/initramfs-tools/hooks/udev:
    - Follow symlinks when finding link files to copy into initramfs
      (LP: #1868892)

 -- Dan Streetman <email address hidden> Mon, 20 Apr 2020 10:12:49 -0400

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 229-4ubuntu21.28

---------------
systemd (229-4ubuntu21.28) xenial; urgency=medium

  * d/t/logind: skip if nonexistent /sys/power/state (LP: #1862657)
  * d/p/lp1839290-Change-job-mode-of-manager-triggered-restarts-to-JOB.patch:
    - when restarting service after failure, replace existing queued jobs
      (LP: #1839290)
  * d/t/storage:
    - fix buggy test (LP: #1831459)
    - without scsi_debug, skip test (LP: #1847816)
  * d/p/lp1867421-70-mouse.hwdb-Set-DPI-for-MS-Classic-IntelliMouse.patch:
    - fix resolution of IntelliMouse (LP: #1867421)
  * d/p/lp1858412-journalctl-allow-running-vacuum-on-remote-journals-t.patch:
    - allow vacuuming journal 'root' dir (LP: #1858412)
  * d/p/lp1862232-network-DHCP-ignore-error-in-setting-hostname-when-i.patch:
    - do not let invalid hostname break dhcpv4 (LP: #1862232)
  * d/t/systemd-fsckd: Skip test on arm64 (LP: #1870194)
  * d/p/lp1837914-journal-do-not-trigger-assertion-when-journal_file_c.patch:
    - do not crash if NULL passted to journal destructor (LP: #1837914)
  * d/e/initramfs-tools/hooks/udev:
    - Follow symlinks when finding link files to copy into initramfs
      (LP: #1868892)

 -- Dan Streetman <email address hidden> Mon, 20 Apr 2020 10:17:40 -0400

Changed in systemd (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.