Sometimes I see that firing the "
launchctl load /Library/LaunchAgents/com.xyz.plist" command doesn't load the app at all. This happens rarely but are there any known conditions or situations where this command would fail? This happened when I installed a system update. After reboot the app didnt start. Is there any way to debug launchctl?The contents of the plist are:
<dict><key>Label</key><string>com.xyz</string><key>ProgramArguments</key><array><string>/Applications/xyz.app/Contents/MacOS/xyz</string></array><key>EnvironmentVariables</key><dict><key>OPT</key><string>xyz</string></dict><key>ExitTimeOut</key><integer>10</integer><key>KeepAlive</key><dict><key>SuccessfulExit</key><false/> </dict><key>RunAtLoad</key><true/><key>EnableTransactions</key><false/>launchctl dumpstate says the "STATE=WAITING". Why?
com.xyz = {
active count = 0
path = /Library/LaunchAgents/com.xyz.plist
state = waiting
program = /Applications/xyz.app/Contents/MacOS/xyz
arguments = {
/Applications/xyz.app/Contents/MacOS/xyz
}
inherited environment = {
DISPLAY => /private/tmp/com.apple.launchd.l2Sd0oCqSk/org.macosforge.xquartz:0
SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.xAs74fJmSt/Listeners
Apple_PubSub_Socket_Render => /private/tmp/com.apple.launchd.4xE3epzUuT/Render
}
default environment = {
PATH => /usr/bin:/bin:/usr/sbin:/sbin
}
environment = {
OPT => xyz
XPC_SERVICE_NAME => com.xyz
}
domain = com.apple.xpc.launchd.user.domain.501.100006.Aqua
asid = 100006
minimum runtime = 10
exit timeout = 5
runs = 1
successive crashes = 0
excessive crashing = 0
last exit code = 0
semaphores = {
successful exit => 0
}
event triggers = {
}
endpoints = {
}
dynamic endpoints = {
}
pid-local endpoints = {
}
instance-specific endpoints = {
}
event channels = {
}
sockets = {
}
spawn type = daemon
cpumon = default
properties = {
partial import = 0
launchd bundle = 0
xpc bundle = 0
keepalive = 0
runatload = 1
dirty at shutdown = 0
low priority i/o = 0
low priority background i/o = 0
legacy timer behavior = 0
exception handler = 0
multiple instances = 0
supports transactions = 0
supports pressured exit = 0
enter kdp before kill = 0
wait for debugger = 0
app = 0
system app = 0
creates session = 0
inetd-compatible = 0
inetd listener = 0
abandon process group = 0
one-shot = 0
requires reap = 0
event monitor = 0
penalty box = 0
pended non-demand spawn = 0
role account = 0
launch only once = 0
system support = 0
app-like = 0
inferred program = 1
joins gui session = 0
joins host session = 0
parameterized sandbox = 0
resolve program = 0
abandon coalition = 0
extension = 0
nano allocator = 0
no initgroups = 0
start on fs mount = 0
endpoints initialized = 1
disallow all lookups = 0
system service = 0
}
}