Ubuntu 14.10初期化スクリプト:シェル関数 "clean_all"はどこで見つけることができますか?

Ubuntu 14.10初期化スクリプト:シェル関数

私はUbuntu 14.10をインストールしました。デスクトップで私の好きなことの1つは、/ tmpを消去しないことです。 14.10で同じことをしようとしています。起動時に /tmp が消去されるのを防ぐためです。

起動スクリプト(/etc/init.d/mountall-bootclean.sh)のいずれかで "clean_all"が呼び出され、/ tmpがクリアされます。今、私はそれが定義された場所を見つけることができません。

 % sudo grep -r -w -l clean_all /etc
 /etc/init.d/mountall-bootclean.sh
 /etc/init.d/checkroot-bootclean.sh
 /etc/init.d/mountnfs-bootclean.sh

そのうちの1つを見てみましょう/etc/init.d/mountall-bootclean.sh。それは次から始まります:

. /lib/lsb/init-functions

. /lib/init/bootclean.sh

どちらもそれを定義しません。欲求不満を感じ、SSDを装着して以下を試しました。

sudo find /bin /boot /etc /lib* /sbin /usr /var -type f -print0 | xargs -0 -s 4096 sudo grep -s -w -l clean_all

結果?次のファイルにのみ存在します。

/etc/init.d/mountall-bootclean.sh
/etc/init.d/checkroot-bootclean.sh
/etc/init.d/mountnfs-bootclean.sh
/usr/lib/gimp/2.0/python/gimp.so
/var/log/auth.log

clean_allどこでも正義を見つけることができないようなので、非常に明確なものを見逃しているようです!どんなアイデアがありますか?

PS:確認してみると、これもファイルではありません。

ベストアンサー1

私はあなたが見ているこのスクリプトがどのように機能するのかわかりません。それらを見た後、clean_all関数がないため、まったく機能しないようです。おそらく/lib/init/bootclean.shになければならないかもしれませんが、そのファイルは私の14.10には存在しません。

あなたが探すべきこと突然現れる再起動するたびに/ tmpをクリアすると機能します。

 /etc/init/mounted-tmp.conf

起動時に呼び出されました:

# mounted-tmp - Clean /tmp directory
#
# Cleans up the /tmp directory when it does not exist as a temporary
# filesystem.

description     "Clean /tmp directory"

start on (mounted MOUNTPOINT=/tmp) or (mounted MOUNTPOINT=/usr)
# The "/tmp" here is just a default and is overridden by the "start on"
# case above. It protects someone from running this job directly and
# having no $MOUNTPOINT defined.
env MOUNTPOINT=/tmp

[...]

おすすめ記事