Skip to content

units: drop OnFailure= from .target units#14787

Merged
keszybz merged 1 commit intosystemd:masterfrom
keszybz:target-units-cant-fail
Feb 5, 2020
Merged

units: drop OnFailure= from .target units#14787
keszybz merged 1 commit intosystemd:masterfrom
keszybz:target-units-cant-fail

Conversation

@keszybz
Copy link
Copy Markdown
Member

@keszybz keszybz commented Feb 5, 2020

See c80a9a3, target units can't fail.
I guess we need to figure out some replacement functionality, but at least
let's avoid the warning from systemd for now.

See c80a9a3, target units can't fail.
I guess we need to figure out some replacement functionality, but at least
let's avoid the warning from systemd for now.
@keszybz keszybz added the units label Feb 5, 2020
@keszybz keszybz added this to the v245 milestone Feb 5, 2020
@yuwata yuwata added the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Feb 5, 2020
@keszybz
Copy link
Copy Markdown
Member Author

keszybz commented Feb 5, 2020

bionic-i386 seems to fail with a timeout, probably unrelated.
travis fails in Debian Testing (clang) build, unrelated too.

@keszybz keszybz added ci-failure-appears-unrelated and removed good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed labels Feb 5, 2020
@keszybz keszybz merged commit c7220ca into systemd:master Feb 5, 2020
@intelfx
Copy link
Copy Markdown
Contributor

intelfx commented Jul 8, 2020

@keszybz is it right? .target units can fail, for example by dependencies, no?

I've just had an occurrence when one of my machines booted up to multi-user.target despite having failed a non-optional mount in fstab. I suppose this is why?

# systemctl status mnt-data.mount local-fs.target multi-user.target
● mnt-data.mount - /mnt/data
     Loaded: loaded (/etc/fstab; generated)
     Active: inactive (dead)
      Where: /mnt/data
       What: /dev/disk/by-label/storage
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)

Jul 08 15:19:11 anystation systemd[1]: Dependency failed for /mnt/data.
Jul 08 15:19:11 anystation systemd[1]: mnt-data.mount: Job mnt-data.mount/start failed with result 'dependency'.

● local-fs.target - Local File Systems
     Loaded: loaded (/usr/lib/systemd/system/local-fs.target; static; vendor preset: disabled)
     Active: inactive (dead) since Wed 2020-07-08 15:17:40 MSK; 55min ago
       Docs: man:systemd.special(7)

Jul 08 15:17:40 archlinux systemd[1]: Stopped target Local File Systems.
Jul 08 15:19:11 anystation systemd[1]: Dependency failed for Local File Systems.
Jul 08 15:19:11 anystation systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.
Warning: journal has been rotated since unit was started, output may be incomplete.

● multi-user.target - Multi-User System
     Loaded: loaded (/usr/lib/systemd/system/multi-user.target; static; vendor preset: disabled)
     Active: active since Wed 2020-07-08 15:19:12 MSK; 53min ago
       Docs: man:systemd.special(7)

Jul 08 15:19:12 anystation systemd[1]: Reached target Multi-User System.

@keszybz
Copy link
Copy Markdown
Member Author

keszybz commented Jul 8, 2020

According to c80a9a3, they can't. @poettering?

@intelfx
Copy link
Copy Markdown
Contributor

intelfx commented Jul 8, 2020

@keszybz if targets can't fail, then how did it ever work before? Meaning the emergency transition on a failed mount.

@boucman
Copy link
Copy Markdown
Contributor

boucman commented Jul 8, 2020

all units can fail on timeouts... right ? there are timeouts in the [Unit] section IIRC

@intelfx
Copy link
Copy Markdown
Contributor

intelfx commented Jul 8, 2020

No, that's job timeouts. When a job times out, the target unit doesn't change state: JobTimeoutSec=.

@arvidjaar
Copy link
Copy Markdown
Contributor

According to c80a9a3, they can't.

You are aware that OnFailure is also triggered by job failures, are not you?

        /* Trigger OnFailure dependencies that are not generated by
         * the unit itself. 

/* Trigger OnFailure dependencies that are not generated by

@keszybz keszybz self-assigned this Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants