99needrestart
/etc/apt/apt.conf.d/99needrestart 는 library update 뒤 재시작이 필요한 daemon, service, session 이 있는지 점검하도록 needrestart 를 APT 후처리에 걸어 두는 파일이다.
Summary
- package 설치나 업그레이드 뒤 재시작 필요 여부를 자동 점검한다.
- 실패해도 package transaction 전체를 깨지 않도록 완화된 hook 로 등록된다.
Path
- Path:
/etc/apt/apt.conf.d/99needrestart - Package:
needrestart - Order:
99prefix 로 가장 마지막 후처리 계층에 가깝다.
Config
# needrestart - Restart daemons after library updates.
#
# Call needrestart after package upgrades/installations and check
# for pending service restarts. Should only be triggered if there
# was no error during installation.
#
DPkg::Post-Invoke {"test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke -m u || true"; };
Notes
- 핵심은
/usr/lib/needrestart/apt-pinvoke -m u를 설치 후에 호출하는 부분이다. -m u는 APT upgrade 문맥에 맞춘 검사 모드로 볼 수 있다.- unattended-upgrades 나 수동 package 작업 후 "어떤 service 를 재시작해야 하나"를 알려주는 역할을 맡는다.
See Also
History
- codex:: 2026-07-13 Added a page for the needrestart post-invoke fragment.