Skip to content

Commit

Permalink
force launchd to unload plist
Browse files Browse the repository at this point in the history
Summary:
in #358 we ended up
in a state where the contents of the plist were correct but launchd
still thought that it should be monitoring the older 4.6 binary.

I don't know how we ended up in such a state, as we unload before we
write out the new plist.

My working theory is that the unload failed for some unknown reason but
we carried on anyway.

Also, this nugget from the man page:

> NOTE: Due to bugs in the previous implementation and long-standing
> client expectations around those bugs, the load and unload subcommands
> will only return a non-zero exit code due to improper usage.
> Otherwise, zero is always returned.

This is a speculative diff to add the `-F` force flag in.  I have no way
to prove whether this will solve this, only that it doesn't break
spawning watchman for me today.
Closes #360

Reviewed By: sid0

Differential Revision: D3874674

Pulled By: wez

fbshipit-source-id: daa7c1581940d286d601546d1ab892c2f1dbddcc
  • Loading branch information
wez authored and Facebook Github Bot 6 committed Sep 16, 2016
1 parent d2aede1 commit 03f4e4e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ static void spawn_via_launchd(void)
char *unload_argv[MAX_DAEMON_ARGS] = {
"/bin/launchctl",
"unload",
"-F",
NULL
};
append_argv(unload_argv, plist_path);
Expand Down

0 comments on commit 03f4e4e

Please sign in to comment.