sevlyar / go-daemon

A library for writing system daemons in golang.
MIT License
2.14k stars 246 forks source link

Cobra incorpration #66

Open papidb opened 4 years ago

papidb commented 4 years ago

Hey thanks for building this awesome project, but I've been having issues using this tool and cobra. If you have an example I can look into I would appreciate it. Thanks.

deniszh commented 3 years ago

Hi @papidb ,

Could you please demonstrate the issue?

Thanks!

harryzcy commented 3 years ago

WasReborn() can be used to check if it's the child process. Something like this could be used:


if daemon.WasReborn() {
    // call Reborn(), defer Release(), etc... again
} else {
    // run cobra logic as normal
}