Why does launchd keep running my server after it quits?
Why does launchd keep running my server after it quits?
- Subject: Why does launchd keep running my server after it quits?
- From: email@hidden
- Date: Sun, 17 Jul 2011 19:55:40 -0500
If there is a better mailing list for this question, please let me
know.
I've got a sample project at: http://ericgorr.net/pq/CST2.zip
In my system.log, I keep seeing the following output:
Jul 17 20:50:35 Glamdring server[2594]: Hello, the server is here...
Jul 17 20:50:35 Glamdring server[2594]: server_check_in... 5
Jul 17 20:50:35 Glamdring server[2594]: Hello, the server is going away
...
Jul 17 20:50:35 Glamdring com.apple.launchd[1] (net.ericgorr.server):
Throttling respawn: Will start in 10 seconds
Jul 17 20:50:45 Glamdring server[2602]: Hello, the server is here...
Jul 17 20:50:45 Glamdring server[2602]: server_check_in... 5
Jul 17 20:50:45 Glamdring server[2602]: Hello, the server is going away
...
Jul 17 20:50:45 Glamdring com.apple.launchd[1] (net.ericgorr.server):
Throttling respawn: Will start in 10 seconds
The plist for the server looks likes:
<?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>EnableTransactions</key>
<true/>
<key>Label</key>
<string>net.ericgorr.server</string>
<key>Program</key>
<string>/usr/local/libexec/server</string>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>server</string>
<string>launchd</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>Sockets</key>
<dict>
<key>net.ericgorr.server.sock</key>
<dict>
<key>Bonjour</key>
<string>server</string>
<key>SockServiceName</key>
<string>1139</string>
</dict>
</dict>
</dict>
</plist>
However, when I do:
~ $launchctl list net.ericgorr.server
{
"Label" = "net.ericgorr.server";
"LimitLoadToSessionType" = "System";
"OnDemand" = true;
"LastExitStatus" = 0;
"TimeOut" = 30;
"Program" = "/usr/local/libexec/server";
"ProgramArguments" = (
"server";
"launchd";
);
"EnableTransactions" = true;
"TransactionCount" = -1;
"Sockets" = {
"net.ericgorr.server.sock" = (
file-descriptor-object;
file-descriptor-object;
);
};
};
Is there any reason why it replaced my KeepAlive and RunAtLoad keys
with the deprecated OnDemand key?
The sample project really doesn't do anything yet. It's only purpose is
to get something simple working...connect to a launchd server and then
watch it go away normally.
I'm sure I'm doing something obviously wrong, but I am not sure what
that might be...
Thank you.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden