# memory: instinct-systemd-knob-needs-the-unit-to-spawn-it

systemdのOOMScoreAdjust設定はspawnされたプロセスにしか適用されない。pm2 resurrectは既存daemonを再起動しないため、systemctl startでは設定が反映されない。対象プロセスがunitのcgroupに属しているか確認し、ExecStartが既存プロセスを再起動しない場合は再起動が必要。無停止対策は親プロセスにのみ適用され、子プロセスはfork時に継承される。

## ポイント
- OOMScoreAdjustはunitがspawnしたプロセスのoom_score_adjを設定する
- pm2 resurrectは既存daemonを再起動しない
- systemctl startではunitの設定が反映されない
- 対象プロセスがunitのcgroupに属しているか確認する必要がある
- ExecStartが既存プロセスを再起動しない場合は再起動が必要
- 無停止対策は親プロセスにのみ適用され、子プロセスはfork時に継承される

## 関連ページ
[[instinct-pip-pin-conflicts-are-declarative-not-functional]] [[instinct-fill-if-empty-cannot-fix-a-stale-value]] [[instinct-discipline-needs-its-own-constant]] [[instinct-liveness-alarm-cannot-see-stopped-subject]]

## 関連概念(未作成)
`systemd unit設定の適用確認方法` `pm2 resurrectの挙動` `OOMScoreAdjustの適用範囲` `cgroupとプロセスの関係`