I have a large set of mac mini's in the field with smb/afp shares enabled. For reasons completely unknown to me the file sharing sometimes gets disabled for some nodes. I could not find a single thing in the logs, but for now I'm trying to write a quick workaround until we can find the issue.
Currently I'm writing a script that simply periodically checks if file sharing is enabled, and otherwise forcing it on again.
A lot can be done with the systemsetup binary, but it can't do anything for filesharing.
Can anyone tell me either what commandline binary is used to enable file sharing, or which services specifically I need to launch with launchctl?
Best Answer
Proper tools in macOS client are sharing and launchctl which have to be run as root:
Check
man sharing
how to use it.To start/stop or load AFP or SMB use:
or
The proper tool to deal with macOS server related tasks is serveradmin which has to be run as root: