Skip to content

Commit bf5339d

Browse files
committed
provide way to shut down daemons across cluster
1 parent 262e215 commit bf5339d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

launch_smf_host.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,14 @@ def usage(msg):
106106
# to allow samba to work with Linux test driver
107107

108108
network_shared_path = os.path.join(top_dir, 'network_shared')
109+
109110
launch_fn = os.path.join(network_shared_path, as_host) + '.smf_launch'
110111
if os.path.exists(launch_fn): # avoid left-over launch files
111112
os.unlink(launch_fn)
112113
log.info('launch filename ' + launch_fn)
114+
115+
shutdown_fn = os.path.join(network_shared_path, 'shutdown_launchers.tmp')
116+
log.info('daemon shutdown filename ' + shutdown_fn)
113117
while True:
114118
try:
115119
with open(launch_fn, 'r') as f:
@@ -125,4 +129,7 @@ def usage(msg):
125129
if e.errno != errno.ENOENT:
126130
raise e
127131
finally:
132+
if os.path.exists(shutdown_fn): # avoid left-over launch files
133+
log.info('saw daemon shutdown file %s, exiting' % shutdown_fn)
134+
sys.exit(0)
128135
time.sleep(1)

0 commit comments

Comments
 (0)