How can I run radmind in Single User mode?

By: Richard Glaser - Revised: 2008-10-14 richard

Mac OS X 10.4 or Earlier

Startup into single-user mode

Disable Open Firmware Password

Note - Open Firmware password will disable startup in single user mode

Restart or startup the Mac into the Open Firmware
(Press Command + Option + O + F keys)

Enter the following command & press return:
setenv security-mode none

Enter password at the prompt & press return.

Enter the following command & press return:
reset-all

This will restart the Mac

Single User Mode

As the Mac starts up, hold down the Command & S keys.

Repair & Mount Boot Volume


Check & repair boot volume

Enter the following command:
fsck -y

If you have journaling enabled, use the command:
fsck -yf

This will check the boot volume's file system, and attempt repair if necessary. Always do this first. Note that this may not be able to fix all problems in a single pass, so if it finds and fixes anything (it'll display "***** FILE SYSTEM WAS MODIFIED *****"), run it again, until it doesn't find any more errors.

Note, sometimes fsck will not properly repair the startup disk it is usually better to use third-party utility DiskWarrior or re-image the hard disk with Apple Software Restore (ASR) if you have a hard disk with continual problems, before running radmind.

Mount boot volume writable

Enter the following command:
mount -uw /

This command remounts the boot volume, enabling write access. You need to do this before you can change anything on disk.

Starting system daemons & components


Start the kernel extension daemon:
/usr/libexec/kextd

Bring up the network; you'll be able to ping IPs only:
/usr/sbin/configd

Start the resolver, so DNS works:
/usr/sbin/lookupd

Run Radmind


Then run the radmind tools. That's it! You could put all these steps into a script, and then you'd have only one command to execute after booting into single-user mode.

Re-enable OFPW


After radmind has completed make sure to enable Open Firmware Password either using Open Firmware, nvram, or Open Firmware GUI utility.

Mac OS X 10.5

Being able to run Radmind on a Mac that is booted into Single User Mode is a key maintenance and repair mechanism for us.  While working  on our migration to 10.5, I found out that the previous incantation of /usr/libexec/kextd, configd, and lookupd to load drivers and services necessary for network access no longer worked.  After much poking about in /System/Library/LaunchDaemons, here's what is needed under 10.5 to get network access so that you can run Radmind in Single User Mode:

% fsck -fy (or skip it at your own peril)
% mount -uw /
% launchctl load /System/Library/LaunchDaemons/com.apple.kextd.plist
% launchctl load /System/Library/LaunchDaemons/com.apple.notifyd.plist
% launchctl load /System/Library/LaunchDaemons/com.apple.configd.plist
% launchctl load /System/Library/LaunchDaemon/com.apple.DirectoryServices.plist

At this point, you can start in with Radmind commands like /usr/local/ bin/ktcheck, etc.

Some observations and notes:
  1. There no longer is /etc/rc.   launchd is here to stay.  Learn it,  and maybe learn to love it.
  2. Even though the Program path in the launchd plist for kextd is  still /usr/libexec/kextd, it won't work if you just run it at the command line.  You must start it via launchctl.
  3. We have the addition of notifyd in the steps compared with 10.4. Without it, configd won't load.
  4. lookupd is no more.  All hail /usr/sbin/DirectoryService.
  5. You can write the commands for launchctl into a file and then pipe it into launchctl as stdin.  That sure saves a lot of typing!