Jump to content
5 posts in this topic

Recommended Posts

Is there some way, and I know there is but I'm more of a PC based guy until now, to make a script run on the shutdown that will delete Extensions.mkext an Extensions.kextcache. The reason i ask this (and many people I have read have this problem too) have slow hard drives based on these files for some reason. I have reloaded the kexts and nothing seems to work. Every forum I have been to doesn't have a solution. So does anyone know how to, or can, make a script to delete those files on shutdown? Thanks!!!

-Kc

I don't get it, why they running slow with Extensions.mkext and kextcahe files?

 

Those files are caches of the Extensions/kexts in the system to not read them one by one again each boot.

 

If I delete cahces my boot time exceeds a minute otherwise it took 16 seconds to boot.

I agree with Macgirl - there is something not right with your system because these files should speed the boot process, not slow it. I'd guess that you have at least one kext that is causing a problem and that the attempt by the system to load it is causing a temporary hang. However that should have the same effect whether or not it's cached. If you still want to change your shutdown process to kill the cache, read on.

 

Shutdown on Unix systems is controlled by a combination of scripts, shell commands and executables. In essence a script is called which carries out actions according to conditions, for which it tests as is goes along. Various other scripts and executables are spawned along the way as the system comes down. OSX and OSx86 appear to be much the same as other flavours of Unix.

 

You can modify the scripts to do whatever you want. Remember you'll need to be root, or sudo the session, and the golden rule when doing anything at the UNIX level - CHECK THE PERMISSIONS. Before and after. I cannot emphasise this enough - more baffling problems stem from wrong permissions than anything else. Period.

 

The base shutdown script is /etc/rc.shutdown and it's called from the binary /sbin/shutdown with options supplied by the user or the system. In its standard form /etc/rc/shutdown simply checks for /etc/rc/shutdown.local, which it calls if it finds it. Then it calls /sbin/SystemStarter with the 'stop' argument - this is a binary which controls system status. Doing a 'strings' on the binaries will show what else gets called along the way.

 

As /etc/rc.shutdown.local doesn't exist in a basebuilt system you can create one with whatever commands you need in it and it will be called and run every time you shut the machine down. That way you don't have to tinker with the system scripts.

 

If you modify the scripts, make sure you know something about shell programming and for heaven's sake back stuff up before changing it.

 

(Caveat - if I missed something that's different in OSx86 I apologise).

×
×
  • Create New...