1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00
Files
rclone/fs/daemon_unix.go
2025-08-22 00:07:58 +01:00

21 lines
448 B
Go

// Daemonization interface for Unix platforms (common definitions)
//go:build !windows && !plan9 && !js && !wasm
package fs
import (
"os"
)
// We use a special environment variable to let the child process know its role.
const (
DaemonMarkVar = "_RCLONE_DAEMON_"
DaemonMarkChild = "_rclone_daemon_"
)
// IsDaemon returns true if this process runs in background
func IsDaemon() bool {
return os.Getenv(DaemonMarkVar) == DaemonMarkChild
}