Skip to content

Commit

Permalink
CHANGE: Use full path GSAD_PID_PATH for PID files
Browse files Browse the repository at this point in the history
The calls of pidfile_create and pidfile_remove are adjusted to use a
full path defined by GSAD_PID_PATH.

(cherry picked from commit 14bf449)
  • Loading branch information
timopollmeier authored and mergify-bot committed Nov 16, 2021
1 parent d1c4d51 commit 7079269
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ if (NOT GVM_RUN_DIR)
set (GVM_RUN_DIR "/run/gvm")
endif (NOT GVM_RUN_DIR)

if (NOT GSAD_PID_PATH)
set (GSAD_PID_PATH "/run/gsad/gsad.pid")
endif (NOT GSAD_PID_PATH)

if (NOT GSAD_PID_DIR)
set (GSAD_PID_DIR "${GVM_RUN_DIR}")
endif (NOT GSAD_PID_DIR)
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ if (GVM_RUN_DIR)
add_definitions (-DGVM_RUN_DIR="${GVM_RUN_DIR}")
endif (GVM_RUN_DIR)

if (GSAD_PID_PATH)
add_definitions (-DGSAD_PID_PATH="${GSAD_PID_PATH}")
endif (GSAD_PID_PATH)

if (GSAD_DATA_DIR)
add_definitions (-DGSAD_DATA_DIR="${GSAD_DATA_DIR}")
endif (GSAD_DATA_DIR)
Expand Down
4 changes: 2 additions & 2 deletions src/gsad.c
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,7 @@ gsad_cleanup ()

gsad_base_cleanup ();

pidfile_remove ("gsad");
pidfile_remove (GSAD_PID_PATH);
}

/**
Expand Down Expand Up @@ -3158,7 +3158,7 @@ main (int argc, char **argv)

/* Write pidfile. */

if (pidfile_create ("gsad"))
if (pidfile_create (GSAD_PID_PATH))
{
g_critical ("%s: Could not write PID file.\n", __func__);
exit (EXIT_FAILURE);
Expand Down

0 comments on commit 7079269

Please sign in to comment.