#12598: Change Sage process name
-------------------------------+--------------------------------------------
Reporter: eviatarbach | Owner: leif
Type: enhancement | Status: new
Priority: major | Milestone: sage-5.10
Component: scripts | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
-------------------------------+--------------------------------------------
Comment (by nbruin):
Replying to [comment:4 jdemeyer]:
> It seems that renaming the process doesn't actually fool `killall` (on
Linux): `killall sage` doesn't work, even if `argv[0]` of that process is
`sage` and `ps` also shows `sage`. It seems that `killall` uses the actual
filename of the executable.
Correct. According to
[http://sourceforge.net/p/psmisc/code/ci/master/tree/src/killall.c
killall.c], it seems killall looks for the program name in
`/proc/<PID>/stat`, and the name there apparently doesn't need to be the
same as in `/proc/<PID>/cmdline`.
This actually causes nasty behaviour for `killall -e` (exist match, not
just on first 15 characters), because that does go looking for
confirmation in `/proc/<PID>/cmdline`, so if the first 15 characters there
don't match then `killall -e` will never work.
Note that `sh mylittlescript` does succeed in getting `mylittlescript`
into `stat` so there is a way for executables to let the name in `stat` be
different from the executable name. In those cases, `sh` is part of
`cmdline`, so `killall -e` is smart enough to go looking in later parts of
`cmdline` as well.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12598#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.