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 option to store pidfile in a different location #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

craigstjean-xebia
Copy link

Description

--pid allows generation of a pidfile in the current directory, however that is not always suitable. In some cases, you may wish to store the pidfile in /var/run or other locations.

What was happening?

Pid file was always stored in the current working directory

What was done?

  • Added a --pidpath option to store the pidfile in a different location
    • Passing a directory (e.g. /var/run) will result in outsystemscc.pid being stored in that directory
    • Passing a file, or a path that does not currently exist (e.g. /var/run/odc.pid) will result in the pid being stored at that filename
  • Retained --pid functionality as to not break backwards compatibility
  • --pid is now the same as --pidpath .

Test steps

  • Run cloud-connector without any pid option, no pidfile should be created
  • Run cloud-connector with --pid, outsystemscc.pid should be created in the current working directory
  • Run cloud-connector with --pidpath pointing to an existing directory, outsystemscc.pid should be created in the given directory
  • Run cloud-connector with --pidpath pointing to an existing file, the pidfile should be written over that file
  • Run cloud-connector with --pidpath pointing to an non-existing file, the pidfile should be written to that file
  • Run cloud-connector with --pidpath pointing to an non-existing file within a directory that also does not exist, an error should be produced and the program should exit

Copy link
Contributor

@bmartins-unit bmartins-unit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello

We appreciate your proposal. Currently, there is a chance to accidentally point the "pidpath" to an existing file (e.g. self "outsystemscc" file, file system) and we have some concerns with this approach.

Feel free to reach out to us with an update that handles this situation. Thanks!

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 this pull request may close these issues.

2 participants