~bohwaz/blog/

Avec de vrais morceaux de 2.0 !

Debian and Ubuntu: /tmp doesn't get cleaned at boot-time anymore?

Sometimes after some magic happening, maybe an upgrade or a custom software setup, I can't remenber, the /tmp directory doesn't get cleaned anymore at boot-time.

The result is that when you are booting your computer you'll find files in /tmp from the previous time when your computer was on. Too bad.

The cause of this can be found in the /lib/init/bootclean.sh file. The clean_tmp() function uses some checks before emptying the directory. And one of those is checking whether the /tmp directory is actually world-writable, using this command:

$ find /tmp -maxdepth 0 -perm -002

If this command returns nothing then you've got the same problem as me: your /tmp directory is not world-writable anymore. Just type in this command:

# chmod a+rwX /tmp

And voilà it's done! You can now check that it works using:

# service checkroot-bootclean.sh start

If your /tmp directory is not empty then you should read on the /lib/init/bootclean.sh script and find which check is avoiding the function to clean your /tmp directory at boot.

Write a comment
(optional)
(optional)
(mandatory)
       _           _                              _     _           
 _ __ | |__   ___ | |_ ___   __ _ _ __ __ _ _ __ | |__ (_) ___ _ __ 
| '_ \| '_ \ / _ \| __/ _ \ / _` | '__/ _` | '_ \| '_ \| |/ _ \ '__|
| |_) | | | | (_) | || (_) | (_| | | | (_| | |_) | | | | |  __/ |   
| .__/|_| |_|\___/ \__\___/ \__, |_|  \__,_| .__/|_| |_|_|\___|_|   
|_|                         |___/          |_|                      
(mandatory)

URLs will create links automatically.
Allowed HTML tags: <blockquote> <cite> <pre> <code> <var> <strong> <em> <del> <ins> <kbd> <samp> <abbr>