Skip to content

Commit

Permalink
Changed defaults for installation locations
Browse files Browse the repository at this point in the history
* SYSCONFDIR is /etc by default now
* LOCALSTATEDIR is /var by default now
* OPENVAS_RUN_DIR is /run/ospd by default now
* OPENVAS_FEED_LOOK_PATH is /var/lib/openvas/feed-update.lock by default
  now

/run/ospd is used because normally openvas is started from ospd-openvas
which by default uses the /run/ospd path in the systemd service file.
This ensures that the directory for the OPENVAS_RUN_DIR exists at
runtime.

/var/lib/openvas/feed-update.lock is used because the sync scripts may
be started when the services are stopped an /run/ospd (or an other
directory in /run) is not available anymore.
  • Loading branch information
bjoernricks committed Aug 5, 2021
1 parent dd2a0b7 commit adc9fec
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if (SYSCONF_INSTALL_DIR)
endif (SYSCONF_INSTALL_DIR)

if (NOT SYSCONFDIR)
set (SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc")
set (SYSCONFDIR "/etc")
endif (NOT SYSCONFDIR)

if (NOT EXEC_PREFIX)
Expand Down Expand Up @@ -161,24 +161,25 @@ if (NOT LIBDIR)
endif (NOT LIBDIR)

if (NOT LOCALSTATEDIR)
set (LOCALSTATEDIR "${CMAKE_INSTALL_PREFIX}/var")
set (LOCALSTATEDIR "/var")
endif (NOT LOCALSTATEDIR)

if (NOT DATADIR)
set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
endif (NOT DATADIR)

if (NOT OPENVAS_RUN_DIR)
set (OPENVAS_RUN_DIR "${LOCALSTATEDIR}/run")
set (OPENVAS_RUN_DIR "/run/ospd")
endif (NOT OPENVAS_RUN_DIR)

set (OPENVAS_DATA_DIR "${DATADIR}/openvas")
set (OPENVAS_STATE_DIR "${LOCALSTATEDIR}/lib/openvas")

if (NOT OPENVAS_FEED_LOCK_PATH)
set (OPENVAS_FEED_LOCK_PATH "${OPENVAS_RUN_DIR}/feed-update.lock")
set (OPENVAS_FEED_LOCK_PATH "${OPENVAS_STATE_DIR}/feed-update.lock")
endif (NOT OPENVAS_FEED_LOCK_PATH)
add_definitions (-DOPENVAS_FEED_LOCK_PATH="${OPENVAS_FEED_LOCK_PATH}")

set (OPENVAS_DATA_DIR "${DATADIR}/openvas")
set (OPENVAS_STATE_DIR "${LOCALSTATEDIR}/lib/openvas")
if (NOT GVM_LOG_DIR)
set (GVM_LOG_DIR "${LOCALSTATEDIR}/log/gvm")
endif (NOT GVM_LOG_DIR)
Expand Down

0 comments on commit adc9fec

Please sign in to comment.