Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

autorestart

GoDoc

Go library to restart (via exec) a program when a new version is written to disk.

Basic usage

To restart daemons in conjunction with autoinstall, call RestartOnChange during initialization, e.g.:

import "github.com/tillberg/autorestart"
func main() {
    go autorestart.RestartOnChange()
    ...
}

This restarts the daemon by calling syscall.Exec, which is not portable and is unsupported on Windows. Exec replaces the current process with the new one, maintaining the same PID as before and such. This a super-convenient way to restart processes, but it can be a bit different than what you might expect when being restarted by a parent process; you might want to read about it a little first: linux.die.net wikipedia

Specifically, if your daemon accumulates zombie subprocesses over restarts, the CleanUpChildZombies function might help.

See documentation for additional details.

About

Go utility to restart (via exec) a program when a new version is written to disk

Resources

License

Releases

No releases published

Languages

You can’t perform that action at this time.