Files
certman/app/executor/commands.go
Steven Tracey 6aacbfbb71
All checks were successful
Build (artifact) / build (push) Has been skipped
[CI-SKIP] Store Pre-Claude Code
2026-04-22 22:26:21 -04:00

38 lines
630 B
Go

package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"github.com/spf13/cobra"
)
var (
executorServer *Server
ExecutorCmd = &cobra.Command{
Use: "executor",
Short: "Privileged daemon",
RunE: func(cmd *cobra.Command, args []string) error {
return startExecutorCmd()
},
}
)
func startExecutorCmd() error {
executorServer = &Server{}
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
go func() {
<-sigCh
executorServer.Stop()
}()
if err := executorServer.Start(); err != nil {
return fmt.Errorf("failed to start executor server: %w", err)
}
return nil
}