Skip to content

Allow + or - to action only on condition set or unset #330

Open

Description

@hongkongkiwi

I'd really like the option to link conditions so that they only trigger when the condition comes up, but not when it goes down.

Currently I have 3 things running as plugins, dbus, chrony & qmi-proxy. These need to be run early for various reasons.

I'd love to be able to link other services to these without having them take down the other services.

For example, I'd like to link the condition so that mdevd starts after chrony, but if chrony goes down, I don't want mdevd to be taken down because of it.

I wanted to propose a + or - character, such that + means that the condition only operates when it's set and - means it only triggers when it's not set. No operator means it triggers the service when it's up or down.

To me this feels like a nice extension and is backwards compatible but could provide a lot of flexibility.

What do you think? With this, I think I could stop using plugins for starting services completely.

Another example could be klogd and syslogd. E.g. I want my service to start after syslog starts, but if syslog dies or gets restarted I don't want my critical service to die.

Activity

  1. changed the title [-]Act only on condition set or unset[/-] on Dec 9, 2022
  2. hongkongkiwi commented on Dec 9, 2022

    @hongkongkiwi
    ContributorAuthor

    I think we have discussed it in #21 but that is a separate item. I wanted to add an issue for this as it would be incredibly useful for me and a powerful feature I think.

  3. troglobit commented on Dec 9, 2022

    @troglobit
    Collaborator

    It's a good suggestion, and I understand the use-case even though >90% of our own cases have had the reverse requirement (to actually ensure mdevd be taken down if chrony goes down), which is the reason for why it's designed this way.

    Adapting Finit to your suggestion is a HUGE amount of work to the internals and I don't see us implementing this any time soon.

  4. az143 commented on Oct 23, 2023

    @az143
    Contributor

    how i achieve (more or less exactly) this behaviour with user conditions and no changes to finit is described in #264.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions