Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#32908 - [sage-mathematics] add sage.service to start notebook

Attached to Project: Community Packages
Opened by Andrzej Giniewicz (Giniu) - Thursday, 29 November 2012, 22:37 GMT
Last edited by Daniel Wallace (gtmanfred) - Friday, 24 May 2013, 14:34 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Daniel Wallace (gtmanfred)
Architecture All
Severity Very Low
Priority Low
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When we had initscripts it was hard to do. Now, with systemd it's very easy to start notebook at system start and close it cleanly. I don't have service file which would work for package, I have one that works for development environment (I have sage:users who compiles different versions and I switch symlinks around, that's why I have notebook started that way). Anyway, this already contains clean way to shut down notebook (KillSignal and SendSIGKILL, it sends single ctrl-c for closing) and works remarkably compared to any initscript solution I've seen. That one might be used as starting point.

[Unit]
Description=Sage: Open Source Mathematics Software

[Service]
ExecStart=/usr/local/bin/sage -notebook
Restart=on-failure
User=sage
Group=users
KillSignal=SIGINT
SendSIGKILL=no

[Install]
WantedBy=multi-user.target
This task depends upon

Closed by  Daniel Wallace (gtmanfred)
Friday, 24 May 2013, 14:34 GMT
Reason for closing:  Implemented
Additional comments about closing:  included a systemd --user unit
Comment by Daniel Wallace (gtmanfred) - Thursday, 29 November 2012, 22:45 GMT
i will look into it tonight, and rebuild it tomorrow, I am still testing the 5.4 at work
Comment by lainme (lainme) - Sunday, 06 January 2013, 15:51 GMT
I have created my own sage notebook service like this

1) create directory /srv/sage and set owner to sagemath:sagemath
2) change the $HOME of sagemath user to /srv/sage (I think /srv/sage is more suitable for putting the service files than the default $HOME /opt/sage)
3) create systemd service

[Unit]
Description=A free open-source mathematics software system

[Service]
User=sagemath
Group=sagemath
ExecStart=/bin/sh -c 'cd $HOME && /opt/sage/sage -n interface="localhost" automatic_login=False'
ExecStop=/bin/kill $MAINPID

[Install]
WantedBy=multi-user.target

Since my sage notebook can be accessed from Internet (through lighttpd proxy), the automatic login is disabled. While for a default installation, this may not suitable.
Comment by Daniel Wallace (gtmanfred) - Saturday, 16 February 2013, 21:34 GMT
I am going to include a systemd --user session unit when the next version is released that will be sage@$USER.service, so you can start it with whichever user you want. The next time i rebuild, so probably next month when 5.7 is due.

you can change it from that
Comment by Daniel Wallace (gtmanfred) - Wednesday, 17 April 2013, 01:22 GMT
Now that user sessions are actually working, could you try testing with a user unit instead of a system wide one?
Comment by Daniel Wallace (gtmanfred) - Wednesday, 17 April 2013, 14:08 GMT
Now that user sessions are actually working, could you try testing with a user unit instead of a system wide one?
Comment by Andrzej Giniewicz (Giniu) - Wednesday, 17 April 2013, 14:33 GMT
I will check it tomorrow and let you know.

Loading...