Documentation
¶
Overview ¶
Package proc provides process forking and initialization functionality for one or more IRC clients. This is intended to facilitate zero-downtime binary upgrades by allowing the bot to fork itself and passing existing network connections to the new child process.
A parent forks itself through the Fork() call. The child process then gets access to the client connections through a call to InheritedFiles(). Before calling this, ensure that `flag.Parse()` has been called at least once.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fork ¶
func Fork()
Fork sends SIGUSR1 to the current process. This kickstarts the forking process.
func InheritedFiles ¶
InheritedFiles returns a list of N file descriptors inherited from a previous session through the Fork call.
This function assumes that flag.Parse() has been called at least once already. The `-fork` flag has been registered during initialization of this package.
func Kill ¶
func Kill()
Kill sends SIGINT to the current process. This can be used to cleanly break out of a signal polling loop from anywhere in the program.
func KillParent ¶
func KillParent()
KillParent sends SIGINT to the parent process. This is intended to be called by a child after it has been forked and has re-initialized the inherited connections. The parent may now shut down.
Types ¶
This section is empty.