How to run Sage as a daemon / service?

asked 2014-07-21 02:38:02 -0500

Woodgnome gravatar image

updated 2015-01-14 03:02:50 -0500

FrédéricC gravatar image

This isn't really a question as much as it is an attempt to get the "Sage daemon/service" keywords indexed in search engines (I came upon many people asking for this in my own search).

I figured out how to run Sage as a daemon using Python and sockets - the code can be found in .

I was looking into creating an init script, but my Linux knowledge is too lacking in this area (even when I try to edit the /etc/init.d/skeleton script). In any case anyone who can write a proper init script this would be very welcome - I was imagining something along the lines of an init script calling a binary /usr/bin/sageadmin that would:

  • Start daemon via Sage executable and path to the Python daemon script
  • Stop daemon using sockets
  • Check status using sockets

As for the sageadminbinary I can write the socket C code, but I'm not sure what else is required. seems to have a couple of good points, but again - I'm not that comfortable with writing code for something this low level in Linux.

So to sum up: I've made the Python script for "daemonizing" Sage - I'm hoping someone else (with more complete Linux knowledge) can write an init script and the required parts of a sageadmin binary.

edit retag flag offensive close merge delete