github.com/Axway/agent-sdk@v1.1.101/pkg/cmd/service/daemon/daemonlinux.go (about)

     1  package daemon
     2  
     3  // Get the daemon properly
     4  func newDaemon(name, description string, dependencies []string) (Daemon, error) {
     5  	// newer subsystem must be checked first
     6  	if _, err := fs.Stat("/run/systemd/system"); err == nil {
     7  		return &systemDRecord{name, description, dependencies, "", "", "", ""}, nil
     8  	}
     9  	return nil, ErrUnsupportedSystem
    10  }
    11  
    12  // Get executable path
    13  func execPath() (string, error) {
    14  	return fs.Readlink("/proc/self/exe")
    15  }