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

Add 'mkdir -p, --parents' style functionality to --state-directory #40

Open
jhenderson-pro opened this issue Mar 20, 2023 · 3 comments · May be fixed by #46
Open

Add 'mkdir -p, --parents' style functionality to --state-directory #40

jhenderson-pro opened this issue Mar 20, 2023 · 3 comments · May be fixed by #46
Assignees

Comments

@jhenderson-pro
Copy link

In internal ref https://secure.helpscout.net/conversation/2175262282/30980?folderId=6397333 it was mentioned it would be helpful to have the functionality to allow creating of parent directory and subdirectory from the check command, for instance:

--state-directory /var/test1/test2

Where the /var/test1 directory does not yet exist, this will currently error out.

@asachs01
Copy link

Could be a sane default of the state directory existing in the asset cache dir? The ideal end user experience is that wouldn't have to worry about setting this attribute at all. $SENSU_LOG_CHECK_PATH/java_log_blah_check.

After discussion, the proposed change is to adding --state-file-name to prevent any possibility of collisions. This would enable users to set the state directory to a directory owned by sensu /var/cache/sensu/sensu-agent and then this directory would contain named state files.

@fguimond
Copy link

@jhenderson-pro - We're not sure we understand the solution proposed by Aaron, do you have any more context?

@fguimond
Copy link

The current behavior is we create the state directory, but not recursively. After discussions we will go ahead and change the behavior to create the directory recursively (like mkdir -p) instead of just one level deep. The documentation and change logs will also be updated to reflect the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants