読み込み中...
読み込み中...
[Unit] / [Service] / [Install] セクションでよく使うディレクティブをまとめた Linux サービスファイル用リファレンス。
最終更新日 ・ by yuzlrin
出典: systemd.unit(5) / systemd.service(5) man page。
| 項目 | 内容 |
|---|---|
| [Unit] Description= | ユニットの説明文 (ログに表示) |
| [Unit] After= / Before= | 起動順序指定 (Requires/Wants とは独立) |
| [Unit] Requires= / Wants= | 強い依存 / 弱い依存 |
| [Unit] Conflicts= | 同時起動を禁止するユニット |
| [Unit] ConditionPathExists= | 条件に合わないと起動しない |
| [Service] Type= | simple / forking / oneshot / notify / exec / idle |
| [Service] ExecStart= | 起動コマンド (絶対パス) |
| [Service] ExecStop= / ExecReload= | 停止 / リロードコマンド |
| [Service] Restart= | always / on-failure / on-abort / no |
| [Service] User= / Group= | 実行ユーザー / グループ |
| [Service] Environment= | 環境変数 (KEY=VALUE 形式) |
| [Service] WorkingDirectory= | 実行時カレントディレクトリ |
| [Service] StandardOutput= / Error= | journal / null / file:PATH など |
| [Install] WantedBy= | enable 時にリンクされるターゲット (例: multi-user.target) |
| [Install] Alias= | 別名で systemctl から呼べるようにする |