sevlyar / go-daemon

A library for writing system daemons in golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cobra incorpration

papidb opened this issue · comments

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.

Hi @papidb ,

Could you please demonstrate the issue?

Thanks!

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
}