SageMath and xinetd

asked 2018-11-18 09:10:50 -0500

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

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        =
        server      = /home/sage/
        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


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

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-18 23:55:29 -0500 )edit