TransWikia.com

Where is OS X saving launchctl changes

Super User Asked by Mutti on December 18, 2021

i’m activating my AFP-Server in OSX with:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist

It is running now, but i’m wondering because the file contains no changes!? Where is the system saving the setting?

greetings!

One Answer

I seem to have found the location: it's in /private/var/db/com.apple.xpc.launchd/disabled.plist, as something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    ...
    <key>com.apple.AppleFileServer</key>
    <false/>
    ....
</dict>
</plist>

Since this file lists disabled launch daemons, <false/> = not disabled = loaded, and <true/> = disabled = not loaded. There are also files with user IDs in the names, e.g. disabled.503.plist, which store similar info for launch agents (which can be loaded/unloaded differently for each user).

Another complication I found is that if you enable or disable the file server in System Preferences -> Sharing pane -> File Sharing option, the daemon is loaded or unloaded immediately, but the setting doesn't seem to be saved to the file until later (maybe only next restart?). Changes make with launchctl, on the other hand, are saved to the file immediately. But this does mean that the file's contents doesn't necessarily represent the true state of affairs.

Answered by Gordon Davisson on December 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP