Re: Deleting contents of /tmp on shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sat, Dec 12, 2009 at 02:33:33PM -0500, Thomas Dukes wrote:
> I use to have a line of code in /etc/init.d/syslog (I think this was the
> file) to delete the contents of my /tmp directory on shutdown.

In /etc/init.d/syslog?  That seems like a bad place to put it, even if
it does check (as I assume it must have) the current runlevel, and only
deletes in runlevels [016] or [06]; if it gets killed too early, you
could delete a file from /tmp that is needed to cleanly kill off a
subsequent process.

/etc/init.d/halt calls /sbin/halt.local, which might be a good place,
except that it's already umounted nonessential filesystems by then, so
if you have /tmp on a different fs putting it there won't work.  (You
could mount it from halt.local, clean it, then umount it, but that seems
extremely kludgy.)  You could write your own simple script and link it in
/etc/rc[06].d/ to run after S00killall but before S01halt or S01reboot.
(It is not clear to me whether enough processes are killed off that cleaning
/tmp is safe here; might be worth testing in a noncritical environment
first.)

--keith


-- 
kkeller@xxxxxxxxxxxxx

Attachment: pgpIXTNOvbDry.pgp
Description: PGP signature

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux