mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix startup logging
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
239d61f04b
commit
7d0dea1055
2 changed files with 8 additions and 6 deletions
|
@ -54,9 +54,10 @@ func (cli *DaemonCli) setupConfigReloadTrap() {
|
|||
sa := windows.SecurityAttributes{
|
||||
Length: 0,
|
||||
}
|
||||
ev, _ := windows.UTF16PtrFromString("Global\\docker-daemon-config-" + fmt.Sprint(os.Getpid()))
|
||||
event := "Global\\docker-daemon-config-" + fmt.Sprint(os.Getpid())
|
||||
ev, _ := windows.UTF16PtrFromString(event)
|
||||
if h, _ := windows.CreateEvent(&sa, 0, 0, ev); h != 0 {
|
||||
logrus.Debugf("Config reload - waiting signal at %s", ev)
|
||||
logrus.Debugf("Config reload - waiting signal at %s", event)
|
||||
for {
|
||||
windows.WaitForSingleObject(h, windows.INFINITE)
|
||||
cli.reloadConfig()
|
||||
|
|
|
@ -15,10 +15,11 @@ func (d *Daemon) setupDumpStackTrap(root string) {
|
|||
// Windows does not support signals like *nix systems. So instead of
|
||||
// trapping on SIGUSR1 to dump stacks, we wait on a Win32 event to be
|
||||
// signaled. ACL'd to builtin administrators and local system
|
||||
ev, _ := windows.UTF16PtrFromString("Global\\docker-daemon-" + fmt.Sprint(os.Getpid()))
|
||||
event := "Global\\docker-daemon-" + fmt.Sprint(os.Getpid())
|
||||
ev, _ := windows.UTF16PtrFromString(event)
|
||||
sd, err := winio.SddlToSecurityDescriptor("D:P(A;;GA;;;BA)(A;;GA;;;SY)")
|
||||
if err != nil {
|
||||
logrus.Errorf("failed to get security descriptor for debug stackdump event %s: %s", ev, err.Error())
|
||||
logrus.Errorf("failed to get security descriptor for debug stackdump event %s: %s", event, err.Error())
|
||||
return
|
||||
}
|
||||
var sa windows.SecurityAttributes
|
||||
|
@ -27,11 +28,11 @@ func (d *Daemon) setupDumpStackTrap(root string) {
|
|||
sa.SecurityDescriptor = uintptr(unsafe.Pointer(&sd[0]))
|
||||
h, err := windows.CreateEvent(&sa, 0, 0, ev)
|
||||
if h == 0 || err != nil {
|
||||
logrus.Errorf("failed to create debug stackdump event %s: %s", ev, err.Error())
|
||||
logrus.Errorf("failed to create debug stackdump event %s: %s", event, err.Error())
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
logrus.Debugf("Stackdump - waiting signal at %s", ev)
|
||||
logrus.Debugf("Stackdump - waiting signal at %s", event)
|
||||
for {
|
||||
windows.WaitForSingleObject(h, windows.INFINITE)
|
||||
path, err := signal.DumpStacks(root)
|
||||
|
|
Loading…
Add table
Reference in a new issue