systemd를 중지하고 /tmp를 정리합니다.

systemd를 중지하고 /tmp를 정리합니다.

systemd 이전에는 시스템을 재부팅한 경우에만 /tmp가 정리되었습니다. 그때 나는 매우 행복했습니다.

이제 systemd는 이 수십 년 된 기본값을 변경하여 /tmp가 24시간마다 정리되는 것 같습니다. 나는 행복하지 않다.

systemd를 사용하여 이전의 please-do-not-touch-my-/tmp-even-when-rebooting 동작을 어떻게 얻을 수 있습니까?

여기에서 관련 Q&A를 보았는데 답변이 너무 복잡했습니다.

답변1

이것을 /etc/rc.local에 넣으세요:

# disable the daily cleaning
systemctl disable systemd-tmpfiles-clean.timer
# make sure /tmp is cleaned now (might be superfluous, but what the heck?)
systemctl start systemd-tmpfiles-clean.service

rc.local을 활성화합니다.

 systemctl start rc-local.service

관련 정보