Mark Leone wrote:
>I did it yesterday exactly as you show here, and it didn't work,
>multiple times, with everything double-checked. I tried from the
>Terminal the same classpath combo use din the plist (using absolute
>paths in the plist and the command line) and it worked in Terminal,
>leading me to wonder if I had the plist schema wrong. But today I tried
>the two-path plist, and it worked. So I must have had something else
>wrong yesterday. I'll put this one down as a hardware problem... a loose
>nut on the keyboard. Probably the failure to unload was causing the
>problem, as you mentioned below.
If you rebooted or power-cycled between yesterday and today, that could
explain it.
As I mentioned, launchd will load agent plists and keep using the same
content, even after you replace the file in your ~/Library/LaunchAgents
folder. I think it will even hold the same agent-file between logins. It
will always scan for new agent-files when you login again, but it keeps the
old ones until told to unload them or until it dies. Its idea of "new"
doesn't necessarily include "file modified since time last loaded".
However, if you restart or power-cycle, then launchd will not have any
files loaded at that point, and it will load them all from disk and start
hoarding them again.
If you had corrected a mistake in an in-place agent plist yesterday, or
just made a later edit and not done an 'unload' cmd via lunchctl, then it's
quite possible that any number of 'start' and 'stop' commands would all
fail. They would continue to fail even after you had corrected the problem
in the plist file on disk, and even after a logout/login sequence. The
weird thing is that changing the jars (either the classes or the jar
manifest) can fix some problems, because the process gets relaunched
on-demand, and that relaunch will read the then-current jars on disk.
The launchd daemon can be a very difficult devil to deal with. Some of its
behavior is undocumented or poorly documented. Other behavior is just
inscrutable, like trying to figure out exactly which plist file it has
loaded for any of its jobs. I can't tell you how many times I rebooted
when I was doing my launchd trials last year, just because I couldn't tell
what files launchd was really using or what state it was in. And now that
project is getting ready to start up again, after being deprioritized last
year. Your particular case has turned out to be a well-timed reminder of
practical daemonkeeping.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden