Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/sevlyar/go-daemon
/ functions
Functions
72 in github.com/sevlyar/go-daemon
⨍
Functions
72
◇
Types & classes
8
↓ 9 callers
Method
Remove
Remove removes lock, closes and removes an open file.
lock_file.go:101
↓ 7 callers
Method
Lock
Lock apply exclusive lock on an open file. If file already locked, returns error.
lock_file.go:51
↓ 4 callers
Function
OpenLockFile
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 callers
Method
Reborn
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 callers
Method
Release
Release provides correct pid-file release in daemon.
daemon.go:42
↓ 4 callers
Method
WritePid
WritePid writes current process id to an open file.
lock_file.go:75
↓ 3 callers
Function
CreatePidFile
CreatePidFile opens the named file, applies exclusive lock and writes current process id to file.
lock_file.go:26
↓ 3 callers
Function
NewLockFile
NewLockFile returns a new LockFile with the given File.
lock_file.go:20
↓ 3 callers
Method
Search
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 callers
Method
Unlock
Unlock remove exclusive lock on an open file.
lock_file.go:56
↓ 2 callers
Function
AddCommand
AddCommand is wrapper on AddFlag and SetSigHandler functions.
command.go:8
↓ 2 callers
Method
IsSet
()
command.go:20
↓ 2 callers
Method
ReadPid
ReadPid reads process id from file and returns pid. If unable read from a file, returns error.
lock_file.go:92
↓ 2 callers
Method
Rotate
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 callers
Function
StringFlag
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 callers
Function
requireMinor
(minor int)
compilation_test.go:68
↓ 1 callers
Function
ActiveFlags
ActiveFlags returns flags that has the state 'set'.
command.go:81
↓ 1 callers
Function
AddFlag
AddFlag adds the flag and signal to the internal map.
command.go:66
↓ 1 callers
Function
NewLogFile
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 callers
Function
ReadPidFile
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 callers
Function
SendCommands
SendCommands sends active signals to the given process.
command.go:71
↓ 1 callers
Function
ServeSignals
ServeSignals calls handlers for system signals.
signal.go:26
↓ 1 callers
Function
SetSigHandler
SetSigHandler sets handler for the given signals. SIGTERM has the default handler, he returns ErrStop.
signal.go:19
↓ 1 callers
Function
WasReborn
WasReborn returns true in child process (daemon) and false in parent process.
daemon.go:20
↓ 1 callers
Method
child
()
daemon_unix.go:223
↓ 1 callers
Method
closeFiles
()
daemon_unix.go:166
↓ 1 callers
Method
files
()
daemon_unix.go:202
↓ 1 callers
Function
lockFile
(fd uintptr)
lock_file_stub.go:6
↓ 1 callers
Method
openFiles
()
daemon_unix.go:120
↓ 1 callers
Function
osExecutable
()
os_executable.go:10
↓ 1 callers
Method
parent
()
daemon_unix.go:83
↓ 1 callers
Method
prepareEnv
()
daemon_unix.go:184
↓ 1 callers
Method
reborn
()
daemon_stub.go:43
↓ 1 callers
Method
release
()
daemon_stub.go:51
↓ 1 callers
Method
search
()
daemon_stub.go:47
↓ 1 callers
Function
serveHTTP
()
examples/cmd/gd-simple/simple.go:40
↓ 1 callers
Function
setupLog
()
examples/cmd/gd-log-rotation/main.go:67
↓ 1 callers
Function
signals
()
command.go:91
↓ 1 callers
Function
syscallDup
(oldfd int, newfd int)
syscall_dup.go:11
↓ 1 callers
Function
unlockFile
(fd uintptr)
lock_file_stub.go:10
↓ 1 callers
Function
worker
()
examples/cmd/gd-signal-handling/signal-handling.go:71
↓ 1 callers
Function
worker
()
examples/cmd/gd-log-rotation/main.go:91
Function
BoolFlag
BoolFlag returns new object that implements interface Flag and has state 'set' when var with the given address is true.
command.go:25
Function
Example
()
daemon_test.go:11
Function
Flags
Flags returns flags that was added by the function AddFlag.
command.go:61
Method
IsSet
()
command.go:39
Method
IsSet
()
command.go:51
Function
TestCompilation
(t *testing.T)
compilation_test.go:12
Function
TestCreatePidFile
(test *testing.T)
lock_file_test.go:17
Function
TestLockFileLock
(test *testing.T)
lock_file_test.go:74
Function
TestNewLockFile
(test *testing.T)
lock_file_test.go:45
Function
TestReadPid
(test *testing.T)
lock_file_test.go:57
Method
Write
(b []byte)
examples/cmd/gd-log-rotation/log_file.go:29
Function
httpHandler
(w http.ResponseWriter, r *http.Request)
examples/cmd/gd-simple/simple.go:45
Function
init
()
signal.go:53
Function
lockFile
(fd uintptr)
lock_file_unix.go:10
Function
lockFile
(fd uintptr)
lock_file_solaris.go:11
Function
main
()
examples/cmd/gd-signal-handling/signal-handling.go:19
Function
main
To terminate the daemon use: kill `cat sample.pid`
examples/cmd/gd-simple/simple.go:14
Function
main
()
examples/cmd/gd-log-rotation/main.go:20
Function
osExecutable
()
os_executable_pre18.go:10
Method
reborn
()
daemon_unix.go:56
Method
release
()
daemon_unix.go:264
Function
reloadHandler
(sig os.Signal)
examples/cmd/gd-signal-handling/signal-handling.go:93
Method
search
()
daemon_unix.go:65
Function
sigtermDefaultHandler
(sig os.Signal)
signal.go:57
Function
syscallDup
(oldfd int, newfd int)
syscall_dup_pre17.go:12
Function
syscallDup
(oldfd int, newfd int)
syscall_dup3.go:9
Function
termHandler
(sig os.Signal)
examples/cmd/gd-signal-handling/signal-handling.go:84
Function
termHandler
(sig os.Signal)
examples/cmd/gd-log-rotation/main.go:106
Function
unlockFile
(fd uintptr)
lock_file_unix.go:18
Function
unlockFile
(fd uintptr)
lock_file_solaris.go:27