-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add optional integer argument for --daemonize option #4759
Conversation
:long => "--daemonize", | ||
:description => "Daemonize the process", | ||
:proc => lambda { |p| true } | ||
:short => "-d [WAIT]", |
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.
Will this have backward compatibility implications and break existing scripts?
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 brackets around WAIT
mean it is an optional argument and the proc
below makes it retain the backwards compatible behavior if it is not present
dd2aa0b
to
92b361f
Compare
I'm not sure this addresses #3305 though does it? The problem there is that if you have a non-zero splay and/or interval that you'll always sleep-before-running and this is the behavior that those users do not want to have at all -- they still want splay/interval options, but when present, they want the first run to be immediate and then for the chef-client to sleep afterwards. So a '--sleep-after-run' kind of flag to shift the interval/splay sleeps to the end of the loop. |
@lamont-granquist Unless I'm misunderstanding, this addresses the issue. If they pass |
Ah okay, so i think the problem here is that you're missing all the exception decoration that we normally do around the chef-client run: I think when you're sleeping you also need to have the sleep wrapped around with this logic or i suspect there's some edge conditions you might break: |
@lamont-granquist Okay, that makes sense to me. Thanks! |
92b361f
to
8ca8633
Compare
@lamont-granquist Updated re: your comments; please let me know if you have any other feedback. |
8ca8633
to
793601d
Compare
👍 |
1 similar comment
👍 |
793601d
to
484ae04
Compare
484ae04
to
ed0c48d
Compare
The
--daemonize
option takes an optional integer argument for the number of seconds to wait before the first daemonized run.Closes #3305