Sysinit triggers
April 3rd, 2008 Posted in LinuxWhen you boot up a typical RHEL or CentOS system, there are a number of checks that occur during that boot process. While you can see most of them mentioned during startup, or via the green [OK] during boot if you’ve disabled the quiet boot, a few useful ones are still hidden. These are control files which can be dropped into / by an admin and are checked silently by /etc/rc.sysinit on boot. These hidden files can have a profound impact on your system’s behavior if you use them properly. Because these files aren’t meant to be permenant, they’re often deleted after they’re used.
Autorelabel
If you have the file /.autorelabel your system will check to see if you’re using selinux, and subsequently relabel your entire file structure on boot. If you’re having an issue getting your selinux contexts correct, this is a handy way to fix things if you’re rebooting anyway. Now, this isn’t just a completely automatic utility, so if you want to fine-tune things, or do this on your own, you can add ‘AUTORELABEL=0′ on its own line to /etc/sysconfig/selinux. This will drop you to init1 so that you can fix things manually.
Autofsck
Having a file called /.autofsck will cause the system to fsck its filesystems on boot. If you have a file called /fsckoptions, or /etc/sysconfig/autofsck, they’ll be parsed for instructions about just exactly how you want fsck to run against your file systems.
Forcequotacheck
The /forcequotacheck file does essentially exactly what it says. With this file in place, your system will check every applicable mount point for quota compliance. If you use quotas on your filesystems, keep this one in mind. If not, you can ignore it like everyone else.
Unconfigured
We saved the best for last with this one. The /.unconfigured file, if present on your system will trigger a whole host of actions. This file will on reboot, essentially return the system to a ‘firstboot’-like state. It will prompt you for a keyboard type, root password, network configuration info, timezone, and authentication method. This file is useful for resellers and VARs who push out machines on a regular basis. You can install, configure it how you want it, put all your bits in, and then drop a file and ship it off to a customer to ‘configure’ when it arrives. It also makes for a darn MEAN April fool’s day joke with your local BOFH.