William Stein пишет:
> On Tue, Aug 4, 2009 at 2:42 AM, Serge A. Salamanka<salsa-...@tut.by> wrote:
>>
>> William Stein пишет:
>>> On Mon, Aug 3, 2009 at 9:26 AM, Serge A. Salamanka<salsa-...@tut.by> wrote:
>>>> Dear support,
>>>>
>>>> I'm having a bit of a problem with setting up Sage public server with
>>>> several pool accounts.
>>>>
>>>> Everything is done according to recommendations on
>>>> http://wiki.sagemath.org/DanDrake/JustEnoughSageServer
>>>> except that I have to set up 750 permission for the group of sageusers
>>>> on /home/sageadm (chmod 750 /home/sageadm )
>>>> Otherwise the notebook cells show error "Permission denied"
>>>>
>>>> So I have created dir /home/sageadm/sagenbfiles for notebook server and
>>>> setup 2775 permission.
>>>>
>>>> The server is run by the user sageadm with pool accounts of several
>>>> others with no password by ssh.
>>>>
>>>> I can sign up on the server and the interface but I can't execute simple
>>>> code "2-1" or anything other in the notebook cell.
>>>> It says:
>>>> " Traceback (most recent call last): 2-1
>>>> NameError: name 'os' is not defined
>>>> There was an error loading the sage libraries. Try starting from the
>>>> command line to see what the error is."
>>> Can you manually ssh to the pool accounts and type "sage" to run Sage?
>>> The pool accounts *must* be able to run Sage by just typing "sage".
>>>
>>> William
>>>
>> I can ssh to pool accounts and run sage with no problem.
>>
>> Still no result:
>>
>> Traceback (most recent call last): 2-1
>> NameError: name 'os' is not defined
>> THERE WAS AN ERROR LOADING THE SAGE LIBRARIES. Try starting Sage from
>> the command line to see what the error is.
>>
>>
>> #############################
>>
>> I tried to evaluate .py file from the command line under pool account:
>>
>> [sage...@sagenb ~]$ cat
>> /home/sageadm/sagenbfiles/worksheets/salsa/1/code/8.py
>> # -*- coding: utf_8 -*-
>> from __future__ import with_statement
>> print "b12"
>> os.chdir("/home/sageadm/sagenbfiles/worksheets/salsa/1/cells/11")
>> sage.server.notebook.interact.SAGE_CELL_ID=11
>> print _support_.syseval(sh, ur'''ls''',
>> '/home/sageadm/sagenbfiles/worksheets/salsa/1/cells/11')
>>
>> print "e12"
>> [sage...@sagenb ~]$
>> [sage...@sagenb ~]$ sage -python
>> /home/sageadm/sagenbfiles/worksheets/salsa/1/code/8.py
>> b12
>> Traceback (most recent call last):
>> File "/home/sageadm/sagenbfiles/worksheets/salsa/1/code/8.py", line 4,
>> in <module>
>> os.chdir("/home/sageadm/sagenbfiles/worksheets/salsa/1/cells/11")
>> NameError: name 'os' is not defined
>
> The above looks like a pretty good hint. If you can't do
>
> sage -python
>
> from the server pool accounts, nothing is going to work. You need to
> get to the bottom of why "sage -python" doesn't work.
>
> William
>
I came back to this problem again.
Searched through the source code and found the exact ssh command which
executes to run sage code:
command = 'sage-native-execute ssh -t %s "ulimit %s; %s"'%(server,
ulimit, command)
# from expect.py
sage-native-execute script looks like this:
#!/bin/sh
LD_LIBRARY_PATH=$SAGE_ORIG_LD_LIBRARY_PATH; export LD_LIBRARY_PATH
if [ `uname` = 'Darwin' ]; then
DYLD_LIBRARY_PATH=$SAGE_ORIG_DYLD_LIBRARY_PATH
fi
"$@"
As I understand the problem in environment settings which are transfered
to pool account, is that correct ?
> >
>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---