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

Shutdowner interface and Windows trigger #225

Merged
merged 2 commits into from
Nov 16, 2020

Conversation

varas
Copy link
Contributor

@varas varas commented Jun 26, 2020

This PR addresses #220 replacing #221

Instead of polluting the whole service.Interface another interface is added and triggered from Windows implementation.

@coveralls
Copy link

coveralls commented Jun 26, 2020

Coverage Status

Coverage remained the same at 13.995% when pulling ed10027 on newrelic-forks:win_shutdown into a1c091b on kardianos:master.

// Shutdown provides a place to clean up program execution when the system is being shutdown.
// It is essentially the same as Stop but for the case where machine is being shutdown/restarted
// instead of just normally stopping the service.
Shutdown(s Service) error
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fine implementation.

Please also indicate that if shutdown is called, that either: stop is also called after Shutdown, or the comment mentions that Stop will not be call if shutdown is called.

Otherwise LGTM.

@kardianos
Copy link
Owner

One NIT, then can merge.

Stop won't be called when Shutdown is.
@varas
Copy link
Contributor Author

varas commented Jun 30, 2020

I assume triggering Shutdown call is enough so Stop one is not required, added to doc block.

@brushknight
Copy link

Hello! Can you tell us please, can this be merged soon? Thank you in advance!

1 similar comment
@brushknight
Copy link

Hello! Can you tell us please, can this be merged soon? Thank you in advance!

@brushknight
Copy link

Hello @kardianos, if you have time, can you merge this PR please?

@kardianos kardianos merged commit 41add7e into kardianos:master Nov 16, 2020
@varas varas deleted the win_shutdown branch December 17, 2020 17:25
jamesx04 pushed a commit to centrify/service that referenced this pull request Mar 8, 2021
* chore: Add explicit AIX tag to AIX specific sources (kardianos#245)

Add an explicit AIX build restriction to the AIX specific source
files to allow Go versions <1.12 to compile the module.

* Update .travis.yml (kardianos#248)

Adding both Power & Intel support
arch: ppc64le/amd64

* Detection of interactive session fixed for systemd user services (kardianos#246)

Co-authored-by: Pavel Bazika <pavel.bazika@icewarp.com>

* service(windows): add support for delayed auto start service (kardianos#244)

* service(windows): added option flag for delayed automatic start

* service(windows): added option flag for delayed automatic start

Co-authored-by: Utkarsh Dixit <utkarsh.dixit@siemens.com>

* Fix issue with systemd inactive status. (kardianos#243)

* Run commands as user on systemd when using user service (kardianos#224)

* Shutdowner interface and Windows trigger (kardianos#225)

* Shutdowner interface and Windows trigger

* Updating Shutdown doc

Stop won't be called when Shutdown is.

Co-authored-by: Juan Hernandez <jhernandez@newrelic.com>

* service: go fmt

* Add support for OpenRC services (alpine/busybox) (kardianos#252)

Co-authored-by: secDre4mer <61268450+secDre4mer@users.noreply.github.com>
Co-authored-by: santosh653 <70637961+santosh653@users.noreply.github.com>
Co-authored-by: pavelbazika <pavelbazika@users.noreply.github.com>
Co-authored-by: Pavel Bazika <pavel.bazika@icewarp.com>
Co-authored-by: Utkarsh Dixit <utkarsh.extc@gmail.com>
Co-authored-by: Utkarsh Dixit <utkarsh.dixit@siemens.com>
Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
Co-authored-by: Oliver Kraemer <oliverkra@gmail.com>
Co-authored-by: jhvaras <jhvaras@gmail.com>
Co-authored-by: Juan Hernandez <jhernandez@newrelic.com>
Co-authored-by: Daniel Theophanes <kardianos@gmail.com>
Co-authored-by: Karen Almog <8340149+trawler@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants