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:
parent
029e8b2457
commit
c5dc21e58e
5
main.go
5
main.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user