summaryrefslogtreecommitdiff
path: root/claude/systemd/claude-code@.service
diff options
context:
space:
mode:
Diffstat (limited to 'claude/systemd/claude-code@.service')
-rw-r--r--claude/systemd/claude-code@.service4
1 files changed, 4 insertions, 0 deletions
diff --git a/claude/systemd/claude-code@.service b/claude/systemd/claude-code@.service
index e85507e..7ce0e03 100644
--- a/claude/systemd/claude-code@.service
+++ b/claude/systemd/claude-code@.service
@@ -8,6 +8,10 @@ RemainAfterExit=yes
WorkingDirectory=/home/yyamashita/workspaces/repos/%i
ExecStart=/usr/bin/tmux new-session -d -s claude-%i -c /home/yyamashita/workspaces/repos/%i /usr/local/bin/claude --remote-control %i --dangerously-skip-permissions
ExecStop=-/usr/bin/tmux kill-session -t claude-%i
+# 全セッション同時に再起動すると、tmux サーバーが終了する瞬間に new-session が繋がり
+# "server exited unexpectedly" で失敗することがあるので、少し待って再試行する
+Restart=on-failure
+RestartSec=3
Environment=HOME=/home/yyamashita
Environment=USER=yyamashita
Environment=XDG_RUNTIME_DIR=/run/user/1000