Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Ticket/master/14206 add force reload #40

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
4 participants
Member

haus commented Apr 26, 2012

No description provided.

haus added some commits Apr 26, 2012

(#14206) Add force-reload to debian init script.
This fix adds a force-reload to the mcollective init script to resolve a
lintian error during building. It is implemented using start-stop-daemon with a
signal of USR1, similar to the redhat init script.
Init script cleanup, dead code revival
Previously, the echoing after start, stop and restart would never be reached
because of the exits that were called before them. Similarly, the `touch $lock`
was never reached, which is good because $lock wasn't previously defined. This
refacters the dead code to be run before either of the exits are called. This
also modifies force-reload to run a restart on failure.

@ripienaar ripienaar and 1 other commented on an outdated diff Apr 27, 2012

ext/debian/mcollective.init
;;
restart)
echo "Restarting daemon: " $name
$0 stop
sleep 2
$0 start
- [ $? = 0 ] && { echo "mcollective restarted" ; exit 0 ; }
+ [ $? = 0 ] && { log_success_msg "mcollective restarted" ; exit 0 ; }
+ ;;
+ force-reload)
+ echo "Reloading configuration: " $name
+ start-stop-daemon --stop -q --pidfile ${pidfile} --signal USR1 -a ${mcollectived} -- ${daemonopts}
@ripienaar

ripienaar Apr 27, 2012

Contributor

so I think a full restart is going to be best, USR1 has issues and I am probably going to get rid of it - USR1 also doesnt reload config just agents from disk so a full restart will be best i think

@haus

haus Apr 27, 2012

Member

Cool I'll change that up.

(#14206) Use restart when force-reload is called
Because the USR1 signal doesn't exactly behave as expected this commit amends
the behavior of force-reload to just behave the same as a full restart.
Member

haus commented Apr 29, 2012

Pull updated. I can rebase if desired.

Contributor

ripienaar commented Apr 30, 2012

I think start-stop-daemon already does some logging on its own thats sufficient, with these changes I get:

root@debian:~/marionette-collective/build# /etc/init.d/mcollective stop
Stopping daemon:  mcollective
mcollective stopped.

that seems redundant and not in line with how debian works:

root@debian:~/marionette-collective/build# /etc/init.d/ssh stop
Stopping OpenBSD Secure Shell server: sshd.
root@debian:~/marionette-collective/build# /etc/init.d/ssh start
Starting OpenBSD Secure Shell server: sshd.

we'll leave this one over till 2.1.x

Member

haus commented Apr 30, 2012

Cool, well deleted the previously dead code would also work (but the lock additions would probably still be good).

CLA Signed by haus on 2012-02-06 21:00:00 -0800

Contributor

ploubser commented Sep 4, 2013

@haus not sure if this is still relevant so closing in the mean time. Feel free to reopen.

@ploubser ploubser closed this Sep 4, 2013

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