Opened 15 years ago
Closed 6 years ago
#381 closed enhancement (fixed)
Sage daemon mode
Reported by: | was | Owned by: | mabshoff |
---|---|---|---|
Priority: | minor | Milestone: | sage-duplicate/invalid/wontfix |
Component: | user interface | Keywords: | Sage server background process service |
Cc: | Merged in: | ||
Authors: | Reviewers: | Frédéric Chapoton | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
On May 28, 5:11 pm, Marshall Hampton <hampto...@gmail.com> wrote: > This is more of a unixy process control question but I am applying it > to sage. > > I would like to start a notebook on my office machine while I am at a > conference. I tried logging in with ssh, starting the notebook, > suspending it with ctrl-z, and then putting the suspended process in > the background with bg. This didn't really work, although I could > still restart the notebook server with a browser. I could figure this > out eventually but I am hoping someone reading this list already knows > how to do this. There are several options: 1) use screen - see www.gnu.org/software/screen/ 2) use nohup - see man nohup 3) use disown - see http://www.faqs.org/docs/bashman/bashref_79.html All have their specific advantages, I would just go with screen. It might be worthwhile to offer an option for SAGE to demonize itself. Cheers, Michael Abshoff
Change History (19)
comment:1 Changed 15 years ago by
comment:2 Changed 14 years ago by
- Milestone set to sage-2.8.2
- Owner changed from was to mabshoff
- Status changed from new to assigned
comment:3 Changed 14 years ago by
- Milestone changed from sage-2.8.2 to sage-2.9
comment:4 Changed 11 years ago by
- Report Upstream set to N/A
Look at #7893 (http://trac.sagemath.org/sage_trac/ticket/7893).
It would be good to incorporate the idea of the example to the script in the previous ticket.
comment:5 Changed 9 years ago by
Ping.
The Sage Installation Guide currently lacks this topic. (There's only a reference from the online FAQ to this ticket.)
comment:6 Changed 9 years ago by
- Keywords Sage server background process service added
- Summary changed from SAGE daemon mode to Sage daemon mode
comment:7 Changed 9 years ago by
What's wrong with nohup? It does exactly what you want, why add a Sage option to emulate nohup?
comment:8 follow-up: ↓ 9 Changed 9 years ago by
I think nohup doesn't daemonize. There is a long list of things that should happen when a process is damonized:
The right way to solve this problem would almost certainly involve including this Python module: https://pypi.python.org/pypi/python-daemon/
comment:9 in reply to: ↑ 8 ; follow-up: ↓ 12 Changed 9 years ago by
Replying to was:
I think nohup doesn't daemonize.
True, nohup
itself doesn't daemonize. But normally you would do
$ nohup sage -n &
It's the &
at the end which does the "daemonization".
There is a long list of things that should happen when a process is damonized:
This refers to traditional Unix daemons, which would be quite different from a Sage "daemon" started by an ordinary user.
So it's not clear to me what would be needed for a Sage daemon which is not covered by
$ nohup sage &
comment:10 follow-up: ↓ 11 Changed 9 years ago by
This refers to traditional Unix daemons, which would be quite different from a Sage "daemon" started by an ordinary user.
I think traditional daemonization is the right way to solve this problem. Moreover, it would be a useful step for making it easy to run a sage server as part of the usual system-wide daemons on Unix.
comment:11 in reply to: ↑ 10 Changed 9 years ago by
comment:12 in reply to: ↑ 9 Changed 9 years ago by
Replying to jdemeyer:
Replying to was:
I think nohup doesn't daemonize.
True,
nohup
itself doesn't daemonize. But normally you would do$ nohup sage -n &It's the
&
at the end which does the "daemonization".There is a long list of things that should happen when a process is damonized:
This refers to traditional Unix daemons, which would be quite different from a Sage "daemon" started by an ordinary user.
So it's not clear to me what would be needed for a Sage daemon which is not covered by
$ nohup sage &
Well, you'd at least also have to >/dev/null
.
Inherited file descriptors other than 0, 1 and 2 are left untouched.
nohup
doesn't change the working directory, nor e.g. modify the umask.
The background process doesn't get adopted by init
until you logout, and similar process group specific stuff I think.
(...)
comment:13 Changed 8 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:14 Changed 8 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:15 Changed 8 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:16 Changed 7 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:17 Changed 6 years ago by
- Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
- Status changed from new to needs_review
The problem that this ticket deals with is nowadays solved by using the OS tools such as Upstart in Ubuntu for example. So I think there needs no further discussion on this matter.
comment:18 Changed 6 years ago by
- Reviewers set to Frédéric Chapoton
- Status changed from needs_review to positive_review
comment:19 Changed 6 years ago by
- Resolution set to fixed
- Status changed from positive_review to closed