Check binary path of PID lock

This commit is contained in:
Daniel
2021-01-26 14:15:07 +01:00
parent ee9ee3dc68
commit 196049a040
2 changed files with 37 additions and 6 deletions

View File

@@ -130,7 +130,10 @@ func run(opts *Options, cmdArgs []string) (err error) {
// check for duplicate instances
if opts.ShortIdentifier == "core" || opts.ShortIdentifier == "hub" {
pid, _ := checkAndCreateInstanceLock(opts.ShortIdentifier)
pid, err := checkAndCreateInstanceLock(opts.ShortIdentifier)
if err != nil {
return fmt.Errorf("failed to exec lock: %w", err)
}
if pid != 0 {
return fmt.Errorf("another instance of %s is already running: PID %d", opts.Name, pid)
}