mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-24 01:31:55 +00:00
cmd/tailscaled/childproc: add be-child registration mechanism
For ssh and maybe windows service babysitter later. Updates #3802 Change-Id: I7492b98df98971b3fb72d148ba92c2276cca491f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
6e4f3614cf
commit
4cbdc84d27
@@ -28,6 +28,7 @@ import (
|
||||
"time"
|
||||
|
||||
"inet.af/netaddr"
|
||||
"tailscale.com/cmd/tailscaled/childproc"
|
||||
"tailscale.com/control/controlclient"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/ipn"
|
||||
@@ -105,6 +106,7 @@ var subCommands = map[string]*func([]string) error{
|
||||
"install-system-daemon": &installSystemDaemon,
|
||||
"uninstall-system-daemon": &uninstallSystemDaemon,
|
||||
"debug": &debugModeFunc,
|
||||
"be-child": &beChildFunc,
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -601,3 +603,17 @@ func mustStartProxyListeners(socksAddr, httpAddr string) (socksListener, httpLis
|
||||
|
||||
return socksListener, httpListener
|
||||
}
|
||||
|
||||
var beChildFunc = beChild
|
||||
|
||||
func beChild(args []string) error {
|
||||
if len(args) == 0 {
|
||||
return errors.New("missing mode argument")
|
||||
}
|
||||
typ := args[0]
|
||||
f, ok := childproc.Code[typ]
|
||||
if !ok {
|
||||
return fmt.Errorf("unknown be-child mode %q", typ)
|
||||
}
|
||||
return f(args[1:])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user