From 97f545c16aba505d11236839e530b618f4904a7c Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 23 May 2008 14:49:25 +0000 Subject: [PATCH] moved stop/start actions out to functions git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1339 9efc2488-bf62-4759-914b-345cdb29e865 --- src/python/opensrf.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/python/opensrf.py b/src/python/opensrf.py index 72cd3ee..2be6da3 100755 --- a/src/python/opensrf.py +++ b/src/python/opensrf.py @@ -66,7 +66,8 @@ as_daemon = '-d' in options pidfile = "%s/osrf_py_%s.pid" % (pid_dir, service) -if action == 'start': +def do_start(): + # connect to the OpenSRF network osrf.system.System.net_connect( @@ -90,7 +91,7 @@ if action == 'start': controller.run() -elif action == 'stop': +def do_stop(): file = open(pidfile) pid = file.read() file.close() @@ -98,3 +99,12 @@ elif action == 'stop': os.remove(pidfile) +if action == 'start': + do_start() + +elif action == 'stop': + do_stop() + +elif action == 'restart': + do_stop() + do_start() -- 2.43.2