Documentation ¶
Index ¶
- Variables
- func Daemon(toRun Funk)
- func KillPID(pidFilename string) bool
- func LogDaemon(msg string)
- func LogFilename(filename *string)
- func PIDFilename(filename *string)
- func PersistPID(pidFilename string) bool
- func ReadPIDFile(pidFilename string) (int, bool)
- func ServiceName() string
- func Start(toRun Funk)
- func Status()
- func StatusPID(pidFilename string) string
- func Stop()
- func UpdateFile(filename string, filedata string) bool
- func UpdatePIDFile(pidFilename string) bool
- type Funk
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DaemonPIDFile = flag.String("daemon-pid", "", "path for pidfile of daemon") DaemonLogFile = flag.String("daemon-log", "", "path for dumping current status of daemon") )
Functions ¶
func Daemon ¶
func Daemon(toRun Funk)
full start|stop|status via flag daemon, can just pass service as Funk in main to it
func LogFilename ¶
func LogFilename(filename *string)
return standard path to PIDFile for *nix nodes
func PIDFilename ¶
func PIDFilename(filename *string)
return standard path to PIDFile for *nix nodes
func PersistPID ¶
make the current daemon process PIDFile aware in case of servers or so where another instance for same config shall result into error empty param results to "/tmp/<binary-name>.pid"
func ReadPIDFile ¶
returns PID from pidfile and status of the process if stil running
func UpdateFile ¶
update given file content with given data
func UpdatePIDFile ¶
updates PID in given pidfile if a daemon allows multiple instances, let it handle PIDFile naming
Types ¶
Click to show internal directories.
Click to hide internal directories.