#75 change Restart to clear out single-user mode

Some_future_release
open
3
2012-10-09
2009-01-24
Dan Adams
No

I've just found out that if you force single-user mode via ard (Apple Remote Desktop) as root:
nvram boot-args="-s"
reboot

you can have applejack reset those parameters by changing the following in:
/var/root/library/Scripts/applejack.sh

from

function restart() {
loggit -n "Restarting hostname"
countDown
loggit "$GOODBYE"
loggit ""
reboot
}

to

function restart() {
loggit -n "Restarting hostname"
countDown
loggit "$GOODBYE"
loggit ""
nvram boot-args=" "
reboot
}

I was just able to ard a machine, to get it to restart in single-user mode, run the script manually, then restart into gui.

It's as simple as changing one line in applejack.sh

Thanks for your consideration.

Discussion

  • This is interesting. And thanks for the code!

    Here's the problem though. Doing so would mean that AppleJack would clear out the nvram boot-args. What if a user has a setting in there that they want to leave in place?

    What we would need to do is, at startup of AppleJack, see what is in the boot-args, assign that to a variable, and then, at the end, filter out the -s from the variable and then re-write the rest to the boot-args.

    However, there is yet one more issue. What do I do about the user who wants to keep his or her machine set to -s?

    I don't want to further complicate AppleJack by adding command line parameters. Can you think of a way of implementing this that would work for all users, with varying needs?

    Thanks again for the suggestion.