X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/blobdiff_plain/2fe107caa2d1478e3ad74717522fd740764e9be2..2be7f2fd876bd9c69b97f1896b02b6da7249b70f:/debian/invirt-remote-host.init diff --git a/debian/invirt-remote-host.init b/debian/invirt-remote-host.init index d3c3849..1de5697 100755 --- a/debian/invirt-remote-host.init +++ b/debian/invirt-remote-host.init @@ -20,17 +20,35 @@ gen_config() done } -case "$1" in - start|reload|force-reload|restart) +reload_cfg() +{ log_begin_msg "Reloading config for $PACKAGE" gen_config log_end_msg $? invoke-rc.d openbsd-inetd start # returns 1 if inetd is running - [ $? -eq 1 ] && exit 0 +} + +case "$1" in + start) + reload_cfg + + log_begin_msg "Starting the invirt-janitor for $PACKAGE" + daemon -n invirt-janitor -r invirt-janitor + log_end_msg $? + ;; + force-reload|restart) + reload_cfg + + log_begin_msg "Restarting the invirt-janitor for $PACKAGE" + daemon -n invirt-janitor --restart + log_end_msg $? ;; stop) + log_begin_msg "Stopping the invirt-janitor for $PACKAGE" + daemon -n invirt-janitor --stop + log_end_msg $? ;; *) - log_success_msg "Usage: /etc/init.d/$PACKAGE {start|reload|force-reload|restart|stop}" + log_success_msg "Usage: /etc/init.d/$PACKAGE {start|force-reload|restart|stop}" ;; esac