mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
So using "ctrld stop" or service manager to stop ctrld will end up with the same result, stopped ctrld with a working DNS, and deactivation pin code will always have effects if set.
19 lines
582 B
Go
19 lines
582 B
Go
package cli
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
// From: https://learn.microsoft.com/en-us/windows/win32/procthread/process-creation-flags?redirectedfrom=MSDN
|
|
|
|
// SYSCALL_CREATE_NO_WINDOW set flag to run process without a console window.
|
|
const SYSCALL_CREATE_NO_WINDOW = 0x08000000
|
|
|
|
// sysProcAttrForDetachedChildProcess returns *syscall.SysProcAttr instance for running self-upgrade command.
|
|
func sysProcAttrForDetachedChildProcess() *syscall.SysProcAttr {
|
|
return &syscall.SysProcAttr{
|
|
CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP | SYSCALL_CREATE_NO_WINDOW,
|
|
HideWindow: true,
|
|
}
|
|
}
|