Add option to store pidfile in a different location #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?
--pidpath
option to store the pidfile in a different location/var/run
) will result inoutsystemscc.pid
being stored in that directory/var/run/odc.pid
) will result in the pid being stored at that filename--pid
functionality as to not break backwards compatibility--pid
is now the same as--pidpath .
Test steps
cloud-connector
without any pid option, no pidfile should be createdcloud-connector
with--pid
,outsystemscc.pid
should be created in the current working directorycloud-connector
with--pidpath
pointing to an existing directory,outsystemscc.pid
should be created in the given directorycloud-connector
with--pidpath
pointing to an existing file, the pidfile should be written over that filecloud-connector
with--pidpath
pointing to an non-existing file, the pidfile should be written to that filecloud-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