diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-10-31 22:45:58 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-10-31 22:45:58 +0900 |
| commit | 05e1418efa56a773c295a2e072796e220d8d8f51 (patch) | |
| tree | 5669d97650919db74e6f5f0174880e6e9221d770 /claude/systemd | |
| parent | f48002a02c7b75de8add369672c861f63e900df4 (diff) | |
hetzner-admin: stop/start individual services, shown as STOPPED on status page
- run-command.sh: services / stop <name> / start <name> for app and infra
stacks (not caddy, hetzner-admin, status). Stopped names go to
status/stopped.txt (gitignored).
- status: a stopped service that does not respond is STOPPED (gray),
excluded from uptime and DOWN alerts. If it responds it is UP as usual.
- Infra deploy.sh skips stopped stacks; app repo pushes clear the flag.
- claude-code@.service: Restart=on-failure, and restart-sessions.sh restarts
one unit at a time, to avoid the tmux "server exited unexpectedly" race.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N5eS3U54gzjRXzm65Np1RS
Diffstat (limited to 'claude/systemd')
| -rw-r--r-- | claude/systemd/claude-code@.service | 4 |
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 |
