Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record pid of Orocos.run in filesystem #36

Open
jakobs opened this issue Jan 15, 2015 · 3 comments
Open

Record pid of Orocos.run in filesystem #36

jakobs opened this issue Jan 15, 2015 · 3 comments

Comments

@jakobs
Copy link
Member

jakobs commented Jan 15, 2015

I think it would be nice to record the pid of the processes that are spawned by orocos.rb in a file in /tmp, so that we could have a rock-killall to remove leftover processess from failed scripts. Also, this would provide a way to see which tasks belong to rock, and distinguish between different types of task ownerships.

@jakobs jakobs changed the title record pid of spawn in filesystem record pid of Orocos.run in filesystem Jan 15, 2015
@jakobs jakobs changed the title record pid of Orocos.run in filesystem Record pid of Orocos.run in filesystem Jan 15, 2015
@doudou
Copy link
Member

doudou commented Jan 15, 2015

I think it would be nice to record the pid of the processes that are spawned by orocos.rb in a file in /tmp, so that we could have a rock-killall to remove leftover processess from failed scripts. Also, this would provide a way to see which tasks belong to rock, and distinguish between different types of task ownerships.

The problem is to be sure that you keep it up to date ... which is pretty hard.

Tasks can already report their TID. We could make them report their PIDs as well, which would account for the rock-killall thing (list all tasks on name service, kill them, if the task is owned by somebody else you can't kill it)

@goldhoorn
Copy link
Contributor

Why not creating a directory in /tmp with links to /proc, if a process
got killed and the pid is not removed from tmp it does not matter
because the corresponding entry in /proc dosnt exist also any more.
so a rock-killall can cleanup also the structure. Even for deamons it
happen that the daemon died and a entry is still existent.

On 15.01.2015 20:52, Sylvain Joyeux wrote:

I think it would be nice to record the pid of the processes that
are spawned by orocos.rb in a file in /tmp, so that we could have
a rock-killall to remove leftover processess from failed scripts.
Also, this would provide a way to see which tasks belong to rock,
and distinguish between different types of task ownerships.

The problem is to be sure that you keep it up to date ... which is
pretty hard.

Tasks can already report their TID. We could make them report their
PIDs as well, which would account for the rock-killall thing (list all
tasks on name service, kill them, if the task is owned by somebody
else you can't kill it)


Reply to this email directly or view it on GitHub
#36 (comment).

Dipl.-Inf. Matthias Goldhoorn
Space and Underwater Robotic

Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 1
28359 Bremen, Germany

Zentrale: +49 421 178 45-6611

Besuchsadresse der Nebengeschäftstelle:
Robert-Hooke-Straße 5
28359 Bremen, Germany

Tel.: +49 421 178 45-4193
Empfang: +49 421 178 45-6600
Fax: +49 421 178 45-4150
E-Mail: [email protected]

Weitere Informationen: http://www.informatik.uni-bremen.de/robotik

@doudou
Copy link
Member

doudou commented Jan 16, 2015

because the corresponding entry in /proc dosnt exist also any more

It might be reused. You would have to make sure that the PID is not the PID of a new process (as opposed to the one you want to kill) before killing it. Resolving using the CORBA interface would provide this.

Even for deamons it happen that the daemon died and a entry is still existent.

True, and it can get messy when it happens. This is why init systems try very hard to cleanup afterwards (and why the systemd guys prefer handling the PID handling internally instead of letting the init scripts do it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants