foomo / simplecert

golang autocert library for letsencrypt
MIT License
212 stars 34 forks source link

failed to build - renew.go - undefined: syscall.Kill #8

Closed richp10 closed 4 years ago

richp10 commented 4 years ago

Line 99 of renew.go

I'm trying to build on windows - is this library linux only?

dreadl0ck commented 4 years ago

I wasn't aware syscall.Kill is not available on windows.

Propably a SIGCONT could be used to trigger the reload and implement the functionality via https://github.com/shirou/gopsutil cross platform, as SIGHUP is not available on windows.

I can take a look at that next week.

richp10 commented 4 years ago

Thanks - I think SIGHUP is available but not syscal.Kill (see types_windows.go)

Maybe the following is equivalent:

p, err := os.FindProcess(os.Getpid())
if err != nil {
    return err
}
p.Signal(syscall.SIGHUP)

As a quick hack I replaced the offending line with the above and the lib compiled fully.

dreadl0ck commented 4 years ago

Oh even better - fixed with 6afb1e7.

Will create a new release now.

Thanks for your contribution!