aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/service/service_manager.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-08 17:29:45 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-08 17:29:45 +0200
commitc3f38a65921afa19286129fa0c1d5480e959ee2b (patch)
treeaf84d0d34934bbd7f07150981044008def2a70ec /service/service_manager.go
parentconf: read presharedkey as a hexstring when converting to uapi (diff)
downloadwireguard-windows-c3f38a65921afa19286129fa0c1d5480e959ee2b.tar.xz
wireguard-windows-c3f38a65921afa19286129fa0c1d5480e959ee2b.zip
service: print in log after UI exits
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'service/service_manager.go')
-rw-r--r--service/service_manager.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/service/service_manager.go b/service/service_manager.go
index 4f793a1e..cbe2fee0 100644
--- a/service/service_manager.go
+++ b/service/service_manager.go
@@ -151,7 +151,7 @@ func (service *managerService) Execute(args []string, r <-chan svc.ChangeRequest
return
}
- log.Printf("Starting UI process for user: '%s@%s'", username, domain)
+ log.Printf("Starting UI process for user '%s@%s'", username, domain)
attr := &os.ProcAttr{
Sys: &syscall.SysProcAttr{
Token: syscall.Token(userToken),
@@ -168,14 +168,21 @@ func (service *managerService) Execute(args []string, r <-chan svc.ChangeRequest
windows.Close(theirLogMappingHandle)
runtime.UnlockOSThread()
if err != nil {
- log.Printf("Unable to start manager UI process: %v", err)
+ log.Printf("Unable to start manager UI process for user '%s@%s': %v", username, domain, err)
return
}
procsLock.Lock()
procs[session] = proc
procsLock.Unlock()
- proc.Wait()
+
+ processStatus, err := proc.Wait()
+ if err == nil {
+ log.Printf("Exited UI process for user '%s@%s' with status %d", username, domain, processStatus.ExitCode())
+ } else {
+ log.Printf("Unable to wait for UI process for user '%s@%s': %v", username, domain, err)
+ }
+
procsLock.Lock()
delete(procs, session)
procsLock.Unlock()