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

custody and custody-probe assign different meanings to CUSTODY_PROC_DIR #80

Open
wearhere opened this issue Jun 25, 2019 · 0 comments
Open
Labels
bug Something isn't working

Comments

@wearhere
Copy link
Contributor

wearhere commented Jun 25, 2019

Problem

custody treats this environment variable as an override for the root storage directory. custody-probe, on the other hand, treats it as an override for the process statefile directory, which is normally a subdirectory /services of the root storage directory. This prevents custody and probe-instrumented processes (i.e. supervisor) from using the same value for this environment variable; if they do, probes will write statefiles a directory above where custody expects to read them.

Workarounds

If you are on OS X, you probably don't need to set CUSTODY_PROC_DIR at all, since you will find custody's default storage directory writable—the variable was originally added to support Linux.

If do wish to use the variable and also care about keeping the probes functional i.e. you wish to use plugins like https://github.com/mixmaxhq/custody-plugin-start-debugger, then a workaround is to set environment variables like this:

  1. Before launching custody: export CUSTODY_PROC_DIR="/some/base/path"
  2. Before launching supervisor: export CUSTODY_PROC_DIR="/some/base/path/services"

If all you care about is preventing Supervisor from writing files into /usr/local/var (the original motivation for introducing the variable), then you can set CUSTODY_PROC_DIR to any writable directory.

Fixes

A more permanent fix would be to change how custody and/or the probes interpret the variable, and/or introduce new variables. custody-probe's interpretation of the existing variable is probably more accurate than custody's, since the default value here that the probe replaces with the variable is the process directory.

That said, it'd probably be more useful to let users override the root storage directory to prevent custody from writing other files like the settings file into /usr/local/var, so I would be in favor of deprecating CUSTODY_PROC_DIR in favor of a new variable like CUSTODY_STORAGE_DIR that would be analogous to /usr/local/var/custody.

@wearhere wearhere added the bug Something isn't working label Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant