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

[enh] add reload and restart service #611

Merged
merged 3 commits into from Jan 17, 2019

Conversation

Projects
None yet
3 participants
@bourreP
Copy link
Contributor

bourreP commented Jan 8, 2019

The problem

Unable to use yunohost service [...] to restart, reload or reloard-or-restart like systemctl

Solution

Adding this possibility

PR Status

...

How to test

yunohost service restart
yunohost service reload
yunohost service reload_or_restart

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :
Show resolved Hide resolved locales/en.json
@Psycojoker
Copy link
Member

Psycojoker left a comment

Appart from my comment, LGTM, need testing though.

Thx a lot for this first contribution ❤️

@bourreP

This comment has been minimized.

Copy link
Contributor

bourreP commented Jan 9, 2019

Thx for the review!

metavar: NAME

### service_reload_or_restart()
reload_or_restart:

This comment has been minimized.

@alexAubin

alexAubin Jan 15, 2019

Member

Can you elaborate on the intention behind this reload_or_restart ? That's not such a big deal I guess, but I'm just scared by this considering that for example for nginx, doing a restart instead of reload has serious implications as in "this will disconnect every ongoing session".

I don't really understand the use case behind it. Is it just to copy-paste some systemd api ?

This comment has been minimized.

@bourreP

bourreP Jan 15, 2019

Contributor

I'm not an expert in systemd and I copied pasted the api.

But the use case of this command is if you are unsure whether the service has the functionality to reload its configuration, you can use the reload-or-restart command. This will reload the configuration in-place if available. Otherwise, it will restart the service.

If you use this on nginx, as nginx can be reloaded, it should not be restarted.

@alexAubin alexAubin added this to the 3.4.x milestone Jan 16, 2019

@alexAubin
Copy link
Member

alexAubin left a comment

Tested and works OK ! Thanks for the contribution !

I found an ~unrelated bug for which I'll open another small PR

@alexAubin alexAubin merged commit ff12868 into YunoHost:stretch-unstable Jan 17, 2019

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@bourreP bourreP deleted the bourreP:enh-add-reload-and-restart-service branch Jan 17, 2019

@bourreP bourreP restored the bourreP:enh-add-reload-and-restart-service branch Jan 17, 2019

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