FS#23273 - [sage-mathematics] Maybe we should have /etc/rc.d/sage that starts 'sage -notebook'?
Attached to Project:
Community Packages
Opened by Andrzej Giniewicz (Giniu) - Monday, 14 March 2011, 19:59 GMT
Last edited by Thomas Dziedzic (tomd123) - Wednesday, 03 August 2011, 15:00 GMT
Opened by Andrzej Giniewicz (Giniu) - Monday, 14 March 2011, 19:59 GMT
Last edited by Thomas Dziedzic (tomd123) - Wednesday, 03 August 2011, 15:00 GMT
|
Details
In multiple cases one would like to start sage server
together with system, especially if it's running on
dedicated machine. How about creating standard
/etc/rc.d/sage to bring the server up and including it in
the package?
|
This task depends upon
Closed by Thomas Dziedzic (tomd123)
Wednesday, 03 August 2011, 15:00 GMT
Reason for closing: Upstream
Additional comments about closing: reopen when upstream decides to implement the feature request
Wednesday, 03 August 2011, 15:00 GMT
Reason for closing: Upstream
Additional comments about closing: reopen when upstream decides to implement the feature request
I don't exactly know if running sage with root permissions would be a smart thing to do.
I created the sagemath user by running:
useradd -r -c 'Sage daemon' -d /opt/sage -s /bin/false sagemath
I then ran:
sudo -u sagemath sh -c "[ -d /opt/sage/.sage/ ] && export HOME=/opt/sage && HOME=/opt/sage /opt/sage/sage -notebook"
And I got the message:
----------------------------------------------------------------------
| Sage Version 4.6.2, Release Date: 2011-02-25 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
Please wait while the Sage Notebook server starts...
Traceback (most recent call last):
File "/opt/sage/local/bin/sage-notebook", line 9, in <module>
from sage.server.notebook.all import notebook
File "/opt/sage/local/lib/python2.6/site-packages/sage/server/notebook/all.py", line 22, in <module>
from sagenb.notebook.all import *
File "/opt/sage/devel/sagenb/sagenb/notebook/all.py", line 16, in <module>
from notebook_object import notebook, inotebook
File "/opt/sage/devel/sagenb/sagenb/notebook/notebook_object.py", line 17, in <module>
import notebook as _notebook
File "/opt/sage/devel/sagenb/sagenb/notebook/notebook.py", line 35, in <module>
from sagenb.misc.misc import (pad_zeros, cputime, tmp_dir, load, save,
File "/opt/sage/devel/sagenb/sagenb/misc/misc.py", line 13, in <module>
from pkg_resources import resource_filename
File "/opt/sage/local/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 2553, in <module>
File "/opt/sage/local/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 384, in __init__
File "/opt/sage/local/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 399, in add_entry
File "/opt/sage/local/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 1659, in find_on_path
OSError: [Errno 13] Permission denied: '/home/tom'
If this requires upstream patching, then this should be submitted to upstream as a feature request for a daemon mode, or make it play nice with user variables instead.
Any ideas?
sage -notebook directory=/opt/sage/notebook open_viewer=False
or something like that? All options are listed under documentation for notebook function.
sudo -u sagemath sh -c 'export HOME=/opt/sage && [ -d $HOME/.sage/ ] && cd $HOME && /opt/sage/sage -notebook'
Shorter command that works:
sudo -u sagemath sh -c '[ -d $HOME/.sage/ ] && cd $HOME && /opt/sage/sage -notebook'
http://trac.sagemath.org/sage_trac/ticket/381 - SAGE daemon mode
http://trac.sagemath.org/sage_trac/ticket/7893 - Sage server launching script
Maybe upstream needs someone to shake them awake to get this implemented? It seems people have posted patches, but the bugs have gone stagnant.
Hopefully us bothering them will produce some nice results for 4.7 :)
Testing the scripts would be awesome, showing that others are interested in the feature!
Please reopen this bug once upstream implements the following reports:
http://trac.sagemath.org/sage_trac/ticket/381
http://trac.sagemath.org/sage_trac/ticket/7893
Closing