Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support registering and unregistering ncproxy as a Windows service #1046

Merged
merged 1 commit into from
Jul 8, 2021

Conversation

dcantah
Copy link
Contributor

@dcantah dcantah commented Jun 14, 2021

Borrowed heavily from the Containerd implementation:
https://github.com/containerd/containerd/blob/master/cmd/containerd/command/service_windows.go

Go mod vendor to bring in the x/sys/windows/svc package

Signed-off-by: Daniel Canter dcanter@microsoft.com

@dcantah dcantah marked this pull request as ready for review June 15, 2021 20:55
@dcantah dcantah requested a review from a team as a code owner June 15, 2021 20:55
@dcantah
Copy link
Contributor Author

dcantah commented Jun 25, 2021

@anmaxvl @katiewasnothere ptal when you get a chance again.

*logDir = filepath.Dir(binLocation)
} else {
// If a log dir was provided, make sure it exists.
if _, err := os.Stat(*logDir); os.IsNotExist(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we return errors that aren't os.IsNotExist?

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 guess we should just check err != nil as mkdirall will just return nil if the directory already exists.

Copy link
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

small comment and question, otherwise LGTM

@dcantah dcantah force-pushed the ncproxy-service branch from d527cf6 to 453061c Compare July 1, 2021 21:07
@dcantah
Copy link
Contributor Author

dcantah commented Jul 1, 2021

@katiewasnothere Thanks!

@dcantah dcantah force-pushed the ncproxy-service branch 2 times, most recently from 955a6ed to ad95e18 Compare July 1, 2021 21:12
Borrowed heavily from the Containerd implementation:
https://github.com/containerd/containerd/blob/master/cmd/containerd/command/service_windows.go

Go mod vendor to bring in the x/sys/windows/svc package

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
@dcantah dcantah force-pushed the ncproxy-service branch from ad95e18 to 70d89bc Compare July 8, 2021 22:39
@dcantah
Copy link
Contributor Author

dcantah commented Jul 8, 2021

Push was squashing the pr feedback commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants