[Spread-users] Spread shutdown

Theo Schlossnagle jesus at omniti.com
Fri Aug 17 14:54:08 EDT 2001

On Friday, August 17, 2001, at 02:46  PM, Yair Amir wrote:
> This tool does not exist off hand. If you need one, looking at the 
> source
> of monitor.c can show you how to do that with relative ease.
> Daniel Rall wrote:
>> Is there commandline control of the operation of Spread (3.16.0)
>> (i.e. the only way I know to shutdown is option 8 on the spmonitor
>> menu)?  I'm looking for something like apachectl, where I can just say
>> `apachectl graceful` or `apachectl stop` from the commandline to get
>> what I want.

I think the point of the question was missed.  The ideas was to have a 
convenient and understandable way to start and stop spread.  Right now, 
if you run spread you have to background and redirect the output 
somewhere or it can screw up the terminal it is attached to.  (Many 
terminals misbehave and many people are annoyed by backgrounded 
processes printing to the screen.)

Spread responds just fine to 'kill'.  So, the idea is to write a 
spreadctl script that accepts, 'stop' and 'start' as parameters.

start will fail exiting with a false value and print nothing (or print 
"Spread start: failed") if spread is already running.  start will simply 
exit with a true value and print nothing (or print "Spread start: ok") 
after starting Spread successfully if no current instance of spread is 

stop will fail exiting with a false value and print nothing (or print 
"Spread stop: failed") if Spread is not currently running.  If Spread is 
currently running, stop will kill Spread and exit with a true value 
printing nothing (or printing "Spread stop: ok").

Obviously, the startup script needs to know the PID of the spread 
process it started so that it can kill it -- conventional techniques can 
be used for this.

The nice thing about this is the following.  If my machine crashes and 
Spread doesn't exit cleanly, there is a chance that the /tmp/#### unix 
domain socket will be left and a new Spread daemon will not start.  This 
script can remove the /tmp/#### file before starting spread (as it 
checks to see if it is already running before doing anything it is 

Theo Schlossnagle
1024D/82844984/95FD 30F1 489E 4613 F22E  491A 7E88 364C 8284 4984
2047R/33131B65/71 F7 95 64 49 76 5D BA  3D 90 B9 9F BE 27 24 E7

More information about the Spread-users mailing list