Posted on 09-06-2012 06:18 AM
Hey Guys,
Probably a dumb question - but was looking for a way to enable File Sharing (both AFP and SMB) consistently for Mountain Lion via a script or terminal (or config profile, any method that would turn it on). I know the Resource Kit contains a script, but it doesn't seem to enable the LaunchDaemon without the -F flag which I believe would need to happen at each login.
I tried changing the Disabled key to false within the com.apple.AppleFileServer.plist but that didn't seem to stick.
Probably over-thinking this.
Thanks for any suggestions!
Solved! Go to Solution.
Posted on 09-06-2012 12:03 PM
Just realized you were speaking about modifying the "Disabled" key. No need to do that. Add the "-w" flag to your command. It's purpose is to toggle that key:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist
or
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist
Posted on 09-06-2012 06:24 AM
if you change the flag, you will have to load the daemon
launchctl load /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist to start it after you enable it.
Posted on 09-06-2012 06:39 AM
Changed the Disabled key to false in com.apple.AppleFileServer.plist and tried launchctl load /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist but I'm receiving the same error I was getting before: "nothing found to load"
Posted on 09-06-2012 07:39 AM
Try unloading first and then loading after that.
Actually, I'd unload, modify and then load just to keep things clean.
Posted on 09-06-2012 11:49 AM
Still a no go. I can't unload as there isn't anything to unload (Error unloading, even with a -F). I modified the <key>Disabled</key> from <true/> to <false/> , rebooted, and ran the launchctl load /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist again. Still receiving the same error - "nothing found to load". Is there another file that needs to be modified? Do you have a specific set of instructions I could follow? I've tried monitoring for system changes with Composer but I'm not able to locate anything definitive.
Posted on 09-06-2012 12:00 PM
Are you doing the command as sudo?
Posted on 09-06-2012 12:03 PM
Just realized you were speaking about modifying the "Disabled" key. No need to do that. Add the "-w" flag to your command. It's purpose is to toggle that key:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist
or
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist
Posted on 09-06-2012 12:39 PM
Awesome! Thanks for the info, I figured it was something easy that I was missing. I'm assuming enabling SMB under file sharing is similar, just call com.apple.smbd instead?
Posted on 09-06-2012 01:34 PM
Appears that works even though it doesn't seem to activate the File Sharing option in System Preferences. Haven't thoroughly tested. This isn't a setting I need to manage in my environment.
Posted on 10-31-2016 03:13 PM
Bill Saved the day again!
Thanks Bill.
Posted on 10-31-2016 06:19 PM
@rgibbonz BOBBEEEEEEE!
Oh, geez, like more than four years later you find this? You got your CCT too!