Q: How to clean /tmp/ folder contents on shutdown?
- Read General Notes
sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup
sudo gedit /etc/init.d/sysklogd
- Find this section
...
stop)
log_begin_msg "Stopping system log daemon..."
start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile
log_end_msg $?
...
- Add the following line below it
rm -fr /tmp/* /tmp/.??*
- Save the edited file (sample)