Link to home
Start Free TrialLog in
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!
ASKER CERTIFIED SOLUTION
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dogbertius
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.

:)