On Nov 20, 8:23 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> I don't know if that is possible -- let me know.  It would be interesting.

Actually I found a better way to write an init.d script.  It appears
that killing twistd shuts down the whole show.

Adding here on hopes useful to someone...

Working /etc/init.d/sage script.....
(Replace seb with your non-root user account and SAGE_DIR as desired.)

#!/usr/bin/env python

import sys
import os

SAGE_DIR = "/usr/local/sage-3.1.2-ubuntu32bit-i686-intel-i686-Linux"
TWISTD   = SAGE_DIR + "/local/bin/twistd"

def start():
        os.system("su seb -c 'sage -notebook &'")

def stop():
        os.system('kill `ps -ef | grep ' + TWISTD + ' | cut -b 10-14`
\
                   1> /dev/null 2> /dev/null ; sleep 4')

if sys.argv[1] == "start":
        start()

if sys.argv[1] == "stop":
        stop()

if sys.argv[1] == "restart":
        stop()
        start()

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to