2
0
mirror of https://github.com/carlostrub/sisyphus synced 2024-10-31 09:20:15 +00:00

check if sisyphus is running in the background already

This commit is contained in:
Carlo Strub 2017-03-14 21:38:12 +00:00
parent 029e8b2457
commit c5dc21e58e

View File

@ -73,6 +73,11 @@ func main() {
Usage: "run sisyphus",
Action: func(c *cli.Context) {
// check if daemon already running.
if _, err := os.Stat(*pidfile); err == nil {
log.Fatal("sisyphus running or " + *pidfile + " file exists.")
}
log.Print("App runs..........")
// Make arrangement to remove PID file upon receiving the SIGTERM from kill command
ch := make(chan os.Signal, 1)