Is it possible to run a "startup" script when booting into single user mode? I need to be able to boot into single user mode, run my script, then reboot into multiuser mode without any human interaction.
I've done a bunch of research and can't find anything that is clear on the topic, although of course I could replace something else that does run with a wrapper that also launches my script, but I'd prefer to do it in some official way. Ideally, the solution will work in FreeBSD 6 and up, but I'm willing to accept only new versions if it just doesn't exist in the older revs.
EDIT: In response to comments, I'm actually looking to do two things, both of which are probably possible without single user mode, but it is much easier to control all the variables in single user mode if that is at all a possibility:
Grow the filesystem in a vmware installation (I've successfully used these instructions manually).
Zero the free space in all file systems (in this case it is to prepare the VM for export). Again, I don't really need single user mode for this, but it would make things easier.
Of course, these aren't really VM issues, but stuff that I'd like to be able to do in general. The fact that these systems happen to be in VMware is not particularly relevant, and I didn't want to throw people off by confusing them with the fact (some people seem to go a little nutty when virtualization is mentioned, but in most cases it doesn't make a difference).
EDIT2: Regardless of my current reasons, if anyone has any suggestions on how to do this (even hacks if there are no official ways), please post them as an answer.