You won't really optimize anything by removing these scripts. The time they take is negligible.
The *-bootclean.sh
scripts clean up files that must or should not survive a reboot: files in /var/run
, /var/lock
, /tmp
, etc. In Debian with SysVinit, there are three such scripts:
checkroot-bootclean.sh
runs just after the root filesystem is mounted (which can remove spurious files created under directories that will soon become mount points, such as /run
and potentially /tmp
)
mountall-bootclean.sh
runs after local filesystems have been mounted (including e.g. a local separate /tmp
or /var
— or tmpfs filesystems, but there's nothing to clean on these)
mountnfs-bootclean.sh
runs after remote filesystems have been mounted (including e.g. /var
over NFS).
Disabling mountnfs.sh
and mountnfs-bootclean.sh
will not harm your system. However, to determine that, you need to study them carefully. Furthermore, this only applies under the assumption that you will never ever put an NFS filesystem in your fstab. If you know that this is true, then I would very much like you to imbue me with your divination abilities. If you merely believe that this is true, then you need to take into account the risk that your belief proves unfounded at some point.
Every default that you change in the distribution makes your system different, so part of the documentation no longer applies, the testing that others have conducted may no longer apply, the support that you might get could be invalidated, etc. Any change to a default setting is inherently an added complication, and thus should only be performed if there is an actual benefit to be derived from it. Your assertion that removing these scripts will simplify your boot process is false, because you did not take this into account.