Skip to content

Commit edd0838

Browse files
committed
fix: create runtime directory on daemon startup
1 parent b573f13 commit edd0838

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal/daemon/daemon.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ func (d *Daemon) Run() error {
5555
sigCh := make(chan os.Signal, 1)
5656
signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGINT, syscall.SIGHUP)
5757

58+
// Ensure runtime directory exists
59+
if err := os.MkdirAll(filepath.Dir(d.socketPath), 0755); err != nil {
60+
return fmt.Errorf("failed to create runtime directory: %w", err)
61+
}
62+
5863
// Write PID file
5964
pidPath := filepath.Join(filepath.Dir(d.socketPath), "devproxy.pid")
6065
os.WriteFile(pidPath, []byte(fmt.Sprintf("%d", os.Getpid())), 0644)

0 commit comments

Comments
 (0)