8000 doc/using-rkt-with-systemd: fix the go app example by alepuccetti · Pull Request #3217 · rkt/rkt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

doc/using-rkt-with-systemd: fix the go app example #3217

Merged
merged 1 commit into from
Sep 20, 2016

Conversation

alepuccetti
Copy link
Contributor

daemon.SdNotify returns 2 variables.

Copy link
Member
@lucab lucab left a 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)
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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(...)

Copy link
Member

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.

Copy link
Contributor Author

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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sent is not defined.

8000
if err != nil {
log.Printf("daemon.SdNotify READY=1 return: %s", err)
log.Errorf("Notification failed: %s", err)
os.Exit(1)
Copy link
Member

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.

@lucab lucab added this to the v1.16.0 milestone Sep 19, 2016
@lucab lucab self-assigned this Sep 19, 2016
@alepuccetti alepuccetti force-pushed the alessandro/rkt-systemd-doc-fix branch 2 times, most recently from b1b9d07 to 063ec3c Compare September 19, 2016 12:43
@alepuccetti
Copy link
Contributor Author

@lucab updated

`daemon.SdNotify` returns 2 variables.
@alepuccetti alepuccetti force-pushed the alessandro/rkt-systemd-doc-fix branch from 063ec3c to 5491fef Compare September 19, 2016 13:01
Copy link
Member
@lucab lucab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lucab lucab merged commit b8ad784 into rkt:master Sep 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0