Timeline for How to timeout a program with a potentially infinite loop
Current License: CC BY-SA 4.0
        8 events
    
    | when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 11, 2019 at 15:16 | vote | accept | Erel Segal-Halevi | ||
| Mar 11, 2019 at 14:32 | comment | added | Philip Couling | 
        
            
    Yes that should work. As you guess the outer timeout will intervene 1 second after the inner (softer) one tries.
        
     | 
|
| Mar 11, 2019 at 14:14 | comment | added | Erel Segal-Halevi | 
        
            
    Is there a way to first try the 'clean' timeout, and if it does not work, use the 'dirty' way? For example timeout -s 9 2 timeout 1 myscript - after 1 second kill with sigterm, after 2 seconds kill with -9. Will this work?
        
     | 
|
| Mar 11, 2019 at 12:43 | history | undeleted | Philip Couling | ||
| Mar 11, 2019 at 12:43 | history | edited | Philip Couling | CC BY-SA 4.0 | 
        
            
             
                
                    deleted 583 characters in body 
                
             
        
     | 
| Mar 11, 2019 at 12:37 | history | deleted | Philip Couling | via Vote | |
| Mar 11, 2019 at 12:32 | history | edited | Philip Couling | CC BY-SA 4.0 | 
        
            
             
                
                    added 627 characters in body 
                
             
        
     | 
| Mar 11, 2019 at 12:25 | history | answered | Philip Couling | CC BY-SA 4.0 |