-
Notifications
You must be signed in to change notification settings - Fork 880
doc/using-rkt-with-systemd: fix the go app example #3217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your example doesn't build. To be honest, I fear it was not even building before 😞, so thanks for fixing it 👍.
@@ -131,12 +131,17 @@ func main() { | |||
}) | |||
ln, err := net.Listen("tcp", ":5000") | |||
if err != nil { | |||
fmt.Fprintf(os.Stderr, "%v\n", err) | |||
log.Errorf("Listen failed: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no Errorf
in module log
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got confused with another module. will put back fmt.Fprintf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better I will use log.Fatalf(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Fatalf
already calls Exit(1)
internally, so you may also remove that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
os.Exit(1) | ||
} | ||
err = daemon.SdNotify("READY=1") | ||
sent, err = daemon.SdNotify("READY=1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sent
is not defined.
if err != nil { | ||
log.Printf("daemon.SdNotify READY=1 return: %s", err) | ||
log.Errorf("Notification failed: %s", err) | ||
8000 | os.Exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to import module os
.
b1b9d07
to
063ec3c
Compare
@lucab updated |
`daemon.SdNotify` returns 2 variables.
063ec3c
to
5491fef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
daemon.SdNotify
returns 2 variables.