How cleanly kill Sage notebook on command line?

169 views
Skip to first unread message

Chris Seberino

unread,
Oct 4, 2009, 6:43:56 PM10/4/09
to sage-support
I'm writing an /etc/init.d script to start and stop the Sage notebook.

I'm not sure how to cleanly shutdown the notebook from the command
line.

ps -ef shows a lot of sage processes so it isn't obvious which one I
should kill -9.

I tried killing some but can't find the right one that shuts down the
whole operation.

Thanks,

Chris

William Stein

unread,
Oct 4, 2009, 6:53:12 PM10/4/09
to sage-s...@googlegroups.com

Look in the sage_notebook directory (possibly in $HOME/.sage). There
is a file twistd.pid. Do:

kill pid_in_that_file

William

Alex Clemesha

unread,
Oct 4, 2009, 7:01:29 PM10/4/09
to sage-s...@googlegroups.com
On Sun, Oct 4, 2009 at 3:43 PM, Chris Seberino <cseb...@gmail.com> wrote:
>
If you're writing a script, this line is probably what you want:

kill -9 `cat /path/to/twistd.pid` #those are back-ticks


-Alex



>
> Thanks,
>
> Chris
> >
>



--
Alex Clemesha
clemesha.org

Kwankyu

unread,
Oct 5, 2009, 4:49:41 AM10/5/09
to sage-support
Hi,

I am personally using a python script to start and stop Sage server.
It uses screen command and is based on the idea William gave below.
Here is the script:

http://dl.getdropbox.com/u/1465360/sage-server

The script reads in the configuration file ".sage/sage-server.conf". A
sample file is here:

http://dl.getdropbox.com/u/1465360/sage-server.conf

You may look and modify the script for your own needs.

Kwankyu
Reply all
Reply to author
Forward
0 new messages