Feature #637

Kill previous slave+child PID before starting

Added by Alexandre Quessy over 3 years ago. Updated 10 months ago.

Status:New Start date:
Priority:High Due date:
Assignee:Alexandre Quessy % Done:

0%

Category:slave Spent time: -
Target version:0.8
Resolution: Version:
Trac ticket ID:31

Description

How to reproduce :
  • start a lunch with this file:
    HOST = "brrr" 
    USER = "miville" 
    add_command("xeyes", env={"DISPLAY":":0.0"}, user=USER, host=HOST, title="remote_xeyes")
    add_command("xlogo", env={"DISPLAY":":0.0"}, user=USER, host=HOST, title="remote_xlogo")
    
  • crash your computer.

The lunch-slave and xeyes stays alive on the remote host. (brrr)

What we could do to fix this :
  • Store the pid of the slave in /var/tmp/lunch/slave-default-1.pid
  • When launching a slave with the same identifier, read in that pidfile. If the process is alive, kill it.
    try:
      os.kill(pid, 0)
    except OSError:
      # it's dead. Do you stuff.
    else:
      os.kill(pid, 9) # SIGKILL? or SIGINT first?
    
  • Start the child as usual.

History

Updated by Alexandre Quessy almost 3 years ago

I think it's a very good idea...

Updated by Alexandre Quessy 10 months ago

  • Target version changed from 0.6 to 0.8

Also available in: Atom PDF