FAQ
Hi

Could not post issue on github so hope this arrives somewhere and not in
the void

In the sample for Windows Service the following is stated
https://github.com/golang/sys/blob/master/windows/svc/example/install.go :
s, err = m.CreateService(name, exepath, mgr.Config{DisplayName: desc},
"is", "auto-started")

When I tried this sample (with some customization), the service instantly
failed but if remove "is" "auto-started", it works. That would make sense
because:
https://github.com/golang/sys/blob/master/windows/svc/mgr/mgr.go
states this would be extra arguments.

Proposing to remove those from the sample.

Timothy

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Daniel Theophanes at Dec 29, 2015 at 10:15 pm
    Hi Timothy,

    I think the example works just fine. Having arguments for the installer is
    working as intended. If you'd like a simpler (slightly less powerful) API,
    there are two wrappers I've made around the windows/svc packages:
    github.com/kardianos/minwinsvc
    github.com/kardianos/service

    Do you think your program is crashing when it receives arguments it isn't
    expecting?

    On Tuesday, December 29, 2015 at 11:27:56 AM UTC-8, Timothy Dewin wrote:

    Hi

    Could not post issue on github so hope this arrives somewhere and not in
    the void

    In the sample for Windows Service the following is stated
    https://github.com/golang/sys/blob/master/windows/svc/example/install.go :
    s, err = m.CreateService(name, exepath, mgr.Config{DisplayName: desc},
    "is", "auto-started")

    When I tried this sample (with some customization), the service instantly
    failed but if remove "is" "auto-started", it works. That would make sense
    because:
    https://github.com/golang/sys/blob/master/windows/svc/mgr/mgr.go
    states this would be extra arguments.

    Proposing to remove those from the sample.

    Timothy
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Timothy Dewin at Dec 30, 2015 at 9:22 am
    Hi,

    You are right, it works fine in this sample. I see now that the main
    instantly starts the service if it find that the session is not interactive
    and thus ignore any arguments.

    Anyway uploaded my sample (which is basically a copy/paste with small
    modifications) here. Instead of beeping, it just start a webservice.
    https://github.com/tdewin/svcwindowssample/blob/master/svcwindowssample.go

    Thanks!

    Timothy
    On Tuesday, December 29, 2015 at 11:15:00 PM UTC+1, Daniel Theophanes wrote:

    Hi Timothy,

    I think the example works just fine. Having arguments for the installer is
    working as intended. If you'd like a simpler (slightly less powerful) API,
    there are two wrappers I've made around the windows/svc packages:
    github.com/kardianos/minwinsvc
    github.com/kardianos/service

    Do you think your program is crashing when it receives arguments it isn't
    expecting?

    On Tuesday, December 29, 2015 at 11:27:56 AM UTC-8, Timothy Dewin wrote:

    Hi

    Could not post issue on github so hope this arrives somewhere and not in
    the void

    In the sample for Windows Service the following is stated
    https://github.com/golang/sys/blob/master/windows/svc/example/install.go
    :
    s, err = m.CreateService(name, exepath, mgr.Config{DisplayName: desc},
    "is", "auto-started")

    When I tried this sample (with some customization), the service instantly
    failed but if remove "is" "auto-started", it works. That would make sense
    because:
    https://github.com/golang/sys/blob/master/windows/svc/mgr/mgr.go
    states this would be extra arguments.

    Proposing to remove those from the sample.

    Timothy
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 29, '15 at 7:28p
activeDec 30, '15 at 9:22a
posts3
users2
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase