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

Locked, Exiting - Need trap(s) if we have a lockfile (/usr/local/bin/os_patching_fact_generation.sh) #42

Closed
TJM opened this issue Sep 14, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@TJM
Copy link

TJM commented Sep 14, 2018

The shell script /usr/local/bin/os_patching_fact_generation.sh has a lock file, which is fine, but it needs to have trap statements to "cleanly" exit if, for example, the machine is rebooted while it happens to be running.

https://stackoverflow.com/questions/1715137/what-is-the-best-way-to-ensure-only-one-instance-of-a-bash-script-is-running

maybe something like:

trap "rm -f $LOCKFILE; exit" 0 2 3 15

added right near the top somewhere?

@TJM TJM changed the title Cron: Locked, Exiting - Need trap(s) if we have a lockfile (/usr/local/bin/os_patching_fact_generation.sh) Locked, Exiting - Need trap(s) if we have a lockfile (/usr/local/bin/os_patching_fact_generation.sh) Sep 14, 2018
@albatrossflavour albatrossflavour self-assigned this Sep 16, 2018
@albatrossflavour
Copy link
Owner

Thanks @TJM

Addressed in development

@albatrossflavour albatrossflavour added the bug Something isn't working label Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants