-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
do not enable a service disabled by the user #1849
base: dev
Are you sure you want to change the base?
Conversation
helpers/systemd
Outdated
# do not enable a service disabled by the user | ||
if ! yunohost service status $service | grep -q "start_on_boot: disabled"; then | ||
systemctl enable $service --quiet | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I think that part should be entirely removed ... the "start_on_boot" thing is precisely the systemd's enabled/disabled flag, cf https://github.com/YunoHost/yunohost/blob/bookworm/src/service.py#L433
so this code is basically "if the service is enabled, enable it"
# do not enable a service disabled by the user | |
if ! yunohost service status $service | grep -q "start_on_boot: disabled"; then | |
systemctl enable $service --quiet | |
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So how can we do to not re-enable an intentionally disabled service on update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just remove the original systemctl enable $service
like you already did ? ;P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hummm yes x)
why is he here in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we did not really think about the use case of "the user wants the service to be disabled" i think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, but now if a packages uses ynh_add_systemd_config at installation, the service will not be enabled :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue is during upgrade, not install
Co-authored-by: Alexandre Aubin <[email protected]>
Co-authored-by: Alexandre Aubin <[email protected]>
…ted with the ynh cli
…deactivated with the ynh cli" This reverts commit ff78f3a.
The problem
if the admin disabled a service using
yunohost service disable $app
, an upgrade will enable and start it againSolution
check in the systemd helpers if the service has been deactivated before activating or before starting it up
PR Status
done
How to test
...