mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-10-12 01:58:46 +02:00
ctrld keeps a second log file, ctrld-journal.log, next to ctrld.log. The journal holds all warnings and errors and each event with the field journal=true. It stays on disk after a start of the service and after a self-upgrade. Each log file starts with a Log header line. Each log send upload starts with the same line, made at send time, and has a limit of about 16 MB.
26 lines
731 B
Go
26 lines
731 B
Go
//go:build !windows
|
|
|
|
package cli
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func hasElevatedPrivilege() (bool, error) {
|
|
return os.Geteuid() == 0, nil
|
|
}
|
|
|
|
// openLogFile opens a log file. It refuses a symlink, because ctrld often
|
|
// writes its logs as root into a directory that other users can write.
|
|
func openLogFile(path string, flags int) (*os.File, error) {
|
|
return os.OpenFile(path, flags|syscall.O_NOFOLLOW, os.FileMode(0o600))
|
|
}
|
|
|
|
// hasLocalDnsServerRunning reports whether we are on Windows and having Dns server running.
|
|
func hasLocalDnsServerRunning() bool { return false }
|
|
|
|
func ConfigureWindowsServiceFailureActions(serviceName string) error { return nil }
|
|
|
|
func isRunningOnDomainControllerWindows() (bool, int) { return false, 0 }
|