1
// Code forked from Docker project
10
var SdNotifyNoSocket = errors.New("No socket")
12
// SdNotify sends a message to the init daemon. It is common to ignore the error.
13
func SdNotify(state string) error {
14
socketAddr := &net.UnixAddr{
15
Name: os.Getenv("NOTIFY_SOCKET"),
19
if socketAddr.Name == "" {
20
return SdNotifyNoSocket
23
conn, err := net.DialUnix(socketAddr.Net, nil, socketAddr)
29
_, err = conn.Write([]byte(state))