SageMath and xinetd

asked 2018-11-18 16:10:50 +0200

lisbeth gravatar image

hi all, I want to use a Sage script with xinetd daemon, but I got an error message:

Error: environment variable $HOME is not set.
Error setting environment variables by sourcing '/root/SageMath/src/bin/sage-env';
possibly contact sage-devel (see http://groups.google.com/group/sage-devel).

How I can resolve this problem? You can see my xinetd.conf file here:

service sage
{
        disable         = no
        socket_type     = stream
        protocol        = tcp
        user            = sage
        wait            = no
        bind        = 10.19.18.49
        server      = /home/sage/run.sh
        log_type    = FILE /var/log/xinetd_sage.log
        log_on_success  = HOST PID
        log_on_failure  = HOST
        type        = UNLISTED
        port        = 8301
        instances   = 100
        per_source  = 10
        rlimit_cpu  = 3
        nice        = 19
}
edit retag flag offensive close merge delete

Comments

As you can see, sage expects "$HOME" to be set. Apparently, the environment that xinetd sets up does not have HOME set. The obvious solution would be to add a line export HOME=/home/sage to run.sh.

Note that the general advice for starting internet-facing services is "don't". Make sure that whatever you are offering is appropriately firewalled!

nbruin gravatar imagenbruin ( 2018-11-19 06:55:29 +0200 )edit