daemon_stub.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!plan9,!solaris
  2. package daemon
  3. import (
  4. "os"
  5. )
  6. // A Context describes daemon context.
  7. type Context struct {
  8. // If PidFileName is non-empty, parent process will try to create and lock
  9. // pid file with given name. Child process writes process id to file.
  10. PidFileName string
  11. // Permissions for new pid file.
  12. PidFilePerm os.FileMode
  13. // If LogFileName is non-empty, parent process will create file with given name
  14. // and will link to fd 2 (stderr) for child process.
  15. LogFileName string
  16. // Permissions for new log file.
  17. LogFilePerm os.FileMode
  18. // If WorkDir is non-empty, the child changes into the directory before
  19. // creating the process.
  20. WorkDir string
  21. // If Chroot is non-empty, the child changes root directory
  22. Chroot string
  23. // If Env is non-nil, it gives the environment variables for the
  24. // daemon-process in the form returned by os.Environ.
  25. // If it is nil, the result of os.Environ will be used.
  26. Env []string
  27. // If Args is non-nil, it gives the command-line args for the
  28. // daemon-process. If it is nil, the result of os.Args will be used
  29. // (without program name).
  30. Args []string
  31. // If Umask is non-zero, the daemon-process call Umask() func with given value.
  32. Umask int
  33. }
  34. func (d *Context) reborn() (child *os.Process, err error) {
  35. return nil, errNotSupported
  36. }
  37. func (d *Context) search() (daemon *os.Process, err error) {
  38. return nil, errNotSupported
  39. }
  40. func (d *Context) release() (err error) {
  41. return errNotSupported
  42. }