SageMath Notebook in systemd

In this short post I want to show you how to implement the sage notebook as a service in systemd, running as a non-privileged user  (I used a Fedora 20 system here). The service will start the sage notebook server automatically whenever the machine boots. This is very useful if you run sagemath in a VM appliance and do not want to use the graphical login from the VM, but the browser from your VirtualBox host.

Just put the shown file mysage.service into the directory /etc/systemd/system/ and correct the username (or remove the user line if you want to run as root, but I think you should avoid that for security reasons).

The above example will run the sage notebook in secure mode. If you don’t need this, then just remove the secure=True entry from the ExecStart line.

After you have finished editing the file, you just need to run

to get started. Have fun!

Veröffentlicht von


Hi! Ich bin beruflich v.a. im Linux-Umfeld tätig. In meiner Freizeit nähe und koche ich gern - außerdem studiere ich nebenher Mathematik und mache viel Sport. Über all diese Dinge, und was mich sonst noch beschäftigt, schreibe ich hier in meinem Blog.