Avatar of dogbertius
dogbertius
 asked on

Snow Leopard - Startup/shutdown rc.d script equivalent for NFSD

Hi there,

I am mainly a Linux/BSD user. Typically, when running certain startup scripts for network shares, wifi services, etc, the startup commands are in /etc/rc.d/rc.service_name

These scripts only run automatically at system startup if the respective script has executable permissions on it (ie: chmod 0755). For some scripts, I prefer to only run them manually, so I remove executable permissions (chmod a-x /etc/rc.d/rc.service_name), and just manually launch them with sudo (ie: sudo sh /etc/rc.d/rc.service_name start).

How can I do the same thing with OSX (Snow Leopard)? I want to disable nfsd at startup (/sbin/nfsd) so that I am only sharing folders (I already have working NFS shares setup in /etc/exports), and only have the shares active when I manually run a command. I tried removing executable permissions from /sbin/nfsd, but that means that every time I start the system, I have to change the permissions, and then revert those changes before I shut down. I want to make sure nfsd is disabled by default every startup.

Thank you all in advance for your assistance!
Apple OSUnix OSShell Scripting

Avatar of undefined
Last Comment
dogbertius

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
wesly_chen

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
dogbertius

ASKER
That's half of the problem. What can I do to launch NFSD via a single command/script without enabling it by default on system load again?

Thanks!
SOLUTION
wesly_chen

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
dogbertius

ASKER
Awesome! Thanks!

Additionally, in the case of NFSD, I can issue:

sudo nfsd disable

This will disable the service like how lauchctl does. When I start NFSD via "sudo nfsd start" it is a one-off launch, which doesn't affect the default startup options.

dogbertius

ASKER
:)
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes