Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force launchd to unload plist #360

Closed
wants to merge 1 commit into from
Closed

Conversation

wez
Copy link
Contributor

@wez wez commented Sep 14, 2016

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.

Test Plan: with watchman not running and my plist referencing the
internal FB build of watchman, build and run watchman from the checkout
on my mac as ./watchman version. Inspect the plist and observe that
the executable path has changed from the installed location of the
binary to the path to my checkout and that we got a valid watchman
version response.

Summary: in facebook#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.

Test Plan: with watchman not running and my plist referencing the
internal FB build of watchman, build and run watchman from the checkout
on my mac as `./watchman version`.  Inspect the plist and observe that
the executable path has changed from the installed location of the
binary to the path to my checkout and that we got a valid watchman
version response.
@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @Sid0 and @dhruvsinghal to be potential reviewers.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants