linux 开机自动删除/tmp目录下的文件
1: 查看/etc/default/rcs文件: cat /etc/default/rcs
#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.
# delete files in /tmp during boot older than x days.
# '0' means always, -1 or 'infinite' disables the feature
TMPTIME=0
# spawn sulogin during boot, continue normal boot if not used in 30 seconds
SULOGIN=no
# do not allow users to log in until the boot has completed
DELAYLOGIN=no
# assume that the BIOS clock is set to UTC time (recommended)
UTC=yes
# be more verbose during the boot process
VERBOSE=no
# automatically repair filesystems with inconsistencies during boot
FSCKFIX=no
注意红色部分的信息,即可明白
2、根据上述信息,修改 TMPTIME的值即可:
TMPTIME=-1