separate invocation ssh

This commit is contained in:
2026-01-14 12:13:53 +00:00
parent 9b68c6766d
commit 2d7c052970

View File

@@ -35,6 +35,7 @@ import (
var (
initServiceNameArg string
invocationArgs []string
sshControlToken string
)
func main() {
@@ -320,6 +321,7 @@ func init() {
rand.Seed(time.Now().UnixNano())
log.SetFlags(0)
log.SetPrefix("")
sshControlToken = fmt.Sprintf("%d-%d", os.Getpid(), time.Now().UnixNano())
}
func writePBConfig(path, serviceName string) error {
@@ -1935,7 +1937,7 @@ func sshSharedArgs(server string) []string {
}
func sshControlPath(server string) string {
sum := sha1.Sum([]byte(server))
sum := sha1.Sum([]byte(fmt.Sprintf("%s-%s", server, sshControlToken)))
return filepath.Join(sshControlDir(), fmt.Sprintf("pb-ssh-%x.sock", sum))
}