MCPcopy Index your code

hub / github.com/sevlyar/go-daemon / functions

Functions72 in github.com/sevlyar/go-daemon

↓ 9 callersMethodRemove
Remove removes lock, closes and removes an open file.
lock_file.go:101
↓ 7 callersMethodLock
Lock apply exclusive lock on an open file. If file already locked, returns error.
lock_file.go:51
↓ 4 callersFunctionOpenLockFile
OpenLockFile opens the named file with flags os.O_RDWR|os.O_CREATE and specified perm. If successful, function returns LockFile for opened file.
lock_file.go:42
↓ 4 callersMethodReborn
Reborn runs second copy of current process in the given context. function executes separate parts of code in child process and parent process and prov
daemon.go:30
↓ 4 callersMethodRelease
Release provides correct pid-file release in daemon.
daemon.go:42
↓ 4 callersMethodWritePid
WritePid writes current process id to an open file.
lock_file.go:75
↓ 3 callersFunctionCreatePidFile
CreatePidFile opens the named file, applies exclusive lock and writes current process id to file.
lock_file.go:26
↓ 3 callersFunctionNewLockFile
NewLockFile returns a new LockFile with the given File.
lock_file.go:20
↓ 3 callersMethodSearch
Search searches daemons process by given in context pid file name. If success returns pointer on daemons os.Process structure, else returns error. Ret
daemon.go:37
↓ 3 callersMethodUnlock
Unlock remove exclusive lock on an open file.
lock_file.go:56
↓ 2 callersFunctionAddCommand
AddCommand is wrapper on AddFlag and SetSigHandler functions.
command.go:8
↓ 2 callersMethodIsSet
()
command.go:20
↓ 2 callersMethodReadPid
ReadPid reads process id from file and returns pid. If unable read from a file, returns error.
lock_file.go:92
↓ 2 callersMethodRotate
Rotate renames old log file, creates new one, switches log and closes the old file.
examples/cmd/gd-log-rotation/log_file.go:37
↓ 2 callersFunctionStringFlag
StringFlag returns new object that implements interface Flag and has state 'set' when var with the given address equals given value of v.
command.go:31
↓ 2 callersFunctionrequireMinor
(minor int)
compilation_test.go:68
↓ 1 callersFunctionActiveFlags
ActiveFlags returns flags that has the state 'set'.
command.go:81
↓ 1 callersFunctionAddFlag
AddFlag adds the flag and signal to the internal map.
command.go:66
↓ 1 callersFunctionNewLogFile
NewLogFile creates a new LogFile. The file is optional - it will be created if needed.
examples/cmd/gd-log-rotation/log_file.go:16
↓ 1 callersFunctionReadPidFile
ReadPidFile reads process id from file with give name and returns pid. If unable read from a file, returns error.
lock_file.go:62
↓ 1 callersFunctionSendCommands
SendCommands sends active signals to the given process.
command.go:71
↓ 1 callersFunctionServeSignals
ServeSignals calls handlers for system signals.
signal.go:26
↓ 1 callersFunctionSetSigHandler
SetSigHandler sets handler for the given signals. SIGTERM has the default handler, he returns ErrStop.
signal.go:19
↓ 1 callersFunctionWasReborn
WasReborn returns true in child process (daemon) and false in parent process.
daemon.go:20
↓ 1 callersMethodchild
()
daemon_unix.go:223
↓ 1 callersMethodcloseFiles
()
daemon_unix.go:166
↓ 1 callersMethodfiles
()
daemon_unix.go:202
↓ 1 callersFunctionlockFile
(fd uintptr)
lock_file_stub.go:6
↓ 1 callersMethodopenFiles
()
daemon_unix.go:120
↓ 1 callersFunctionosExecutable
()
os_executable.go:10
↓ 1 callersMethodparent
()
daemon_unix.go:83
↓ 1 callersMethodprepareEnv
()
daemon_unix.go:184
↓ 1 callersMethodreborn
()
daemon_stub.go:43
↓ 1 callersMethodrelease
()
daemon_stub.go:51
↓ 1 callersMethodsearch
()
daemon_stub.go:47
↓ 1 callersFunctionserveHTTP
()
examples/cmd/gd-simple/simple.go:40
↓ 1 callersFunctionsetupLog
()
examples/cmd/gd-log-rotation/main.go:67
↓ 1 callersFunctionsignals
()
command.go:91
↓ 1 callersFunctionsyscallDup
(oldfd int, newfd int)
syscall_dup.go:11
↓ 1 callersFunctionunlockFile
(fd uintptr)
lock_file_stub.go:10
↓ 1 callersFunctionworker
()
examples/cmd/gd-signal-handling/signal-handling.go:71
↓ 1 callersFunctionworker
()
examples/cmd/gd-log-rotation/main.go:91
FunctionBoolFlag
BoolFlag returns new object that implements interface Flag and has state 'set' when var with the given address is true.
command.go:25
FunctionExample
()
daemon_test.go:11
FunctionFlags
Flags returns flags that was added by the function AddFlag.
command.go:61
MethodIsSet
()
command.go:39
MethodIsSet
()
command.go:51
FunctionTestCompilation
(t *testing.T)
compilation_test.go:12
FunctionTestCreatePidFile
(test *testing.T)
lock_file_test.go:17
FunctionTestLockFileLock
(test *testing.T)
lock_file_test.go:74
FunctionTestNewLockFile
(test *testing.T)
lock_file_test.go:45
FunctionTestReadPid
(test *testing.T)
lock_file_test.go:57
MethodWrite
(b []byte)
examples/cmd/gd-log-rotation/log_file.go:29
FunctionhttpHandler
(w http.ResponseWriter, r *http.Request)
examples/cmd/gd-simple/simple.go:45
Functioninit
()
signal.go:53
FunctionlockFile
(fd uintptr)
lock_file_unix.go:10
FunctionlockFile
(fd uintptr)
lock_file_solaris.go:11
Functionmain
()
examples/cmd/gd-signal-handling/signal-handling.go:19
Functionmain
To terminate the daemon use: kill `cat sample.pid`
examples/cmd/gd-simple/simple.go:14
Functionmain
()
examples/cmd/gd-log-rotation/main.go:20
FunctionosExecutable
()
os_executable_pre18.go:10
Methodreborn
()
daemon_unix.go:56
Methodrelease
()
daemon_unix.go:264
FunctionreloadHandler
(sig os.Signal)
examples/cmd/gd-signal-handling/signal-handling.go:93
Methodsearch
()
daemon_unix.go:65
FunctionsigtermDefaultHandler
(sig os.Signal)
signal.go:57
FunctionsyscallDup
(oldfd int, newfd int)
syscall_dup_pre17.go:12
FunctionsyscallDup
(oldfd int, newfd int)
syscall_dup3.go:9
FunctiontermHandler
(sig os.Signal)
examples/cmd/gd-signal-handling/signal-handling.go:84
FunctiontermHandler
(sig os.Signal)
examples/cmd/gd-log-rotation/main.go:106
FunctionunlockFile
(fd uintptr)
lock_file_unix.go:18
FunctionunlockFile
(fd uintptr)
lock_file_solaris.go:27