mirror of
https://github.com/rtr7/router7.git
synced 2024-05-06 15:54:52 +00:00
notify: gracefully handle vanishing processes
This commit is contained in:
@ -40,6 +40,9 @@ func Process(name string, sig os.Signal) error {
|
||||
}
|
||||
b, err := ioutil.ReadFile(filepath.Join("/proc", fi.Name(), "cmdline"))
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
continue // process vanished
|
||||
}
|
||||
return err
|
||||
}
|
||||
if !strings.HasPrefix(string(b), name) {
|
||||
|
Reference in New Issue
Block a user