[OpenSRF-GIT] OpenSRF branch master updated. e203c6edd4e02437a56d98f24a7b8c52b142faee
Evergreen Git
git at git.evergreen-ils.org
Thu Sep 5 13:29:05 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".
The branch, master has been updated
via e203c6edd4e02437a56d98f24a7b8c52b142faee (commit)
from 0ef66eea902b50efa360815114c11d40d14560d2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e203c6edd4e02437a56d98f24a7b8c52b142faee
Author: Bill Erickson <berick at esilibrary.com>
Date: Thu Sep 5 10:32:09 2013 -0400
osrf_control --start/stop/restart-services
Provide commands for controling non-router services. This is useful in
a multi-server environment where the router runs on a different server.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
diff --git a/bin/opensrf-perl.pl.in b/bin/opensrf-perl.pl.in
index f9ab8ca..9793569 100755
--- a/bin/opensrf-perl.pl.in
+++ b/bin/opensrf-perl.pl.in
@@ -49,6 +49,9 @@ my $opt_restart = 0;
my $opt_start_all = 0;
my $opt_stop_all = 0;
my $opt_restart_all = 0;
+my $opt_start_services = 0;
+my $opt_stop_services = 0;
+my $opt_restart_services = 0;
my $opt_force_clean_process = 0;
my $opt_quiet = 0;
my $opt_diagnostic = 0;
@@ -83,6 +86,9 @@ GetOptions(
'stop-all' => \$opt_stop_all,
'restart' => \$opt_restart,
'restart-all' => \$opt_restart_all,
+ 'start-services' => \$opt_start_services,
+ 'stop-services' => \$opt_stop_services,
+ 'restart-services' => \$opt_restart_services,
'diagnostic' => \$opt_diagnostic
);
@@ -389,9 +395,15 @@ sub do_start {
return 0;
}
+
sub do_start_all {
- msg("starting all services for $hostname");
+ msg("starting router and services for $hostname");
do_start('router');
+ return do_start_services();
+}
+
+sub do_start_services {
+ msg("starting services for $hostname");
if(grep {$_ eq 'opensrf.settings'} @perl_services) {
do_start('opensrf.settings');
@@ -505,14 +517,13 @@ sub clear_stale_pids {
}
}
-sub do_stop_all {
+sub do_stop_services {
my @signals = @_;
+ @signals = qw/TERM INT KILL/ unless @signals;
- msg("stopping all services for $hostname");
-
+ msg("stopping services for $hostname");
my @services = get_service_list_from_files();
- @signals = qw/TERM INT KILL/ unless @signals;
-
+
for my $signal (@signals) {
my @redo;
@@ -528,6 +539,15 @@ sub do_stop_all {
last unless @services;
}
+ return 1;
+}
+
+sub do_stop_all {
+ my @signals = @_;
+ @signals = qw/TERM INT KILL/ unless @signals;
+
+ do_stop_services(@signals);
+
# graceful shutdown requires the presence of the router, so stop the
# router last. See if it's running first to avoid unnecessary warnings.
do_stop('router', $signals[0]) if get_service_pids_from_file('router');
@@ -618,12 +638,18 @@ sub do_help {
--start
Start the service specified by --service
+ --start-services
+ Start all services but do not start any routers
+
--restart-all
Restart the router and all services
--restart
Restart the service specified by --service
+ --restart-services
+ Restart all services but do not restart any routers
+
--force-clean-process
When starting a service, if a service process is already running
but no pidfile exists, kill the service process before starting
@@ -642,6 +668,9 @@ sub do_help {
If the requested service does not have a matching PID file, an
attempt to locate the PID via 'ps' will be made.
+ --stop-services
+ Stop all services but do not stop any routers. See also --stop-all.
+
--graceful-shutdown-all
Send TERM signal to all services + router
@@ -687,18 +716,23 @@ exit;
do_init() and verify_services($opt_service) if
$opt_start or
$opt_start_all or
+ $opt_start_services or
$opt_restart or
- $opt_restart_all;
+ $opt_restart_all or
+ $opt_restart_services;
# starting services. do_init() handled above
do_start($opt_service) if $opt_start;
do_stop($opt_service) and do_start($opt_service) if $opt_restart;
do_start_all() if $opt_start_all;
+do_start_services() if $opt_start_services;
do_stop_all() and do_start_all() if $opt_restart_all;
+do_stop_services() and do_start_services() if $opt_restart_services;
# stopping services
do_stop($opt_service) if $opt_stop;
do_stop_all() if $opt_stop_all;
+do_stop_services() if $opt_stop_services;
do_stop($opt_service, 'TERM') if $opt_shutdown_graceful;
do_stop($opt_service, 'INT') if $opt_shutdown_fast;
do_stop($opt_service, 'KILL') if $opt_shutdown_immediate;
@@ -719,10 +753,13 @@ do_diagnostic() if $opt_diagnostic;
do_help() if $opt_help or not (
$opt_start or
$opt_start_all or
+ $opt_start_services or
$opt_stop or
$opt_stop_all or
+ $opt_stop_services or
$opt_restart or
$opt_restart_all or
+ $opt_restart_services or
$opt_signal or
$opt_signal_all or
$opt_shutdown_graceful or
-----------------------------------------------------------------------
Summary of changes:
bin/opensrf-perl.pl.in | 51 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 44 insertions(+), 7 deletions(-)
hooks/post-receive
--
OpenSRF
More information about the opensrf-commits
mailing list