Skip to content

softer version of systemctl isolate? #2607

@keszybz

Description

@keszybz

From https://bugzilla.redhat.com/show_bug.cgi?id=708537#c3:

------&<---------
'init 5' translates into 'systemctl isolate graphical.target'.
Isolate does more than people expect:

  • Services that are not obviously pulled in by the new target will be killed.
    This includes services that are usually loaded on-demand, including
    the stdout-syslog-bridge, which the processes connected to it won't like.
    The getty units are also affected by this now that they're autospawned.
  • Oneshot units that have completed successfully before, but don't have
    RemainAfterExit=yes, will be re-run again. This can affect the plymouth
    problem.

So the isolate action is brutal and not really what's expected from runlevel switching. We should not fix isolate, because it is useful in itself, but there should be a new action, say systemctl approach $foo.target. systemd would remember the last approached target and when asked to approach another one, it would compare the set C of units pulled by the current target with the set N of units pulled by the new target. It would stop only units in C-N, it would start units in N-C.
It is obvious that switching from runlevel 5 to 5 would then be a NOP.
------>&---------

Something like this would be useful, not only in the context of switching runlevels, but generally in the context of switching or updating targets. OTOH, maybe the complexity is not worth the trouble.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature requestpid1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions