Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start a service after enabling it #14187

Open
adsr opened this issue Jan 18, 2024 · 3 comments
Open

Start a service after enabling it #14187

adsr opened this issue Jan 18, 2024 · 3 comments
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@adsr
Copy link

adsr commented Jan 18, 2024

Describe the Enhancement:

Add the ability to start a systemd unit but only after enabling it.

Describe the Need:

It's a common operational task is to start a service after enabling it. systemd has a flag for this (--now) which also handles the opposite direction (stopping a service when disabling it).

Current Alternative

An execute resource

@adsr adsr added the Status: Untriaged An issue that has yet to be triaged. label Jan 18, 2024
@rjhornsby
Copy link

Maybe I'm confused about what the problem is, but what you describe

a common operational task is to start a service after enabling it

is something we do all the time:

service 'vault' do
  action %i[enable start]
end

@adsr
Copy link
Author

adsr commented Jan 26, 2024

The distinction is "starting a service unconditionally" vs "starting a service only when it transitions to enabled".

@Tensibai
Copy link
Contributor

Tensibai commented May 6, 2024

This is not something great at all to start only on transition, what if it fail ? do you really want it to stay down on next chef run because the service is already enabled ? That doesn't sounds right in a state description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants