From 011ad2c02ce365da3cfa55a0e7bdeb8286849edc Mon Sep 17 00:00:00 2001 From: Ajay Veluvolu Date: Wed, 16 Feb 2022 11:15:35 -0500 Subject: [PATCH] Remove the Pidfile before starting the server process --- bin/conjur-cli/commands/server.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bin/conjur-cli/commands/server.rb b/bin/conjur-cli/commands/server.rb index 73099847d8..78378ea125 100644 --- a/bin/conjur-cli/commands/server.rb +++ b/bin/conjur-cli/commands/server.rb @@ -31,6 +31,9 @@ def call create_account load_bootstrap_policy + # Clean up the Pidfile + cleanup_pidfile + # Start the Conjur API and service # processes fork_server_process @@ -85,6 +88,16 @@ def load_bootstrap_policy ) || exit(($CHILD_STATUS.exitstatus)) end + def cleanup_pidfile + Process.fork do + puts("Cleaning up the pidfile") + + exec(" + rm -f /opt/conjur-server/tmp/pids/server.pid + ") + end + end + def fork_server_process Process.fork do puts("Conjur v#{conjur_version} starting up...")