Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.8
obs-server
obs-server-2.8-0020-api-Make-api-log-directory-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server-2.8-0020-api-Make-api-log-directory-configurable.patch of Package obs-server
From aca762e9f6da1a63ed2fc5c89fff1569b2f161d7 Mon Sep 17 00:00:00 2001 From: Oleg Girko <ol@infoserver.lv> Date: Sun, 17 Jul 2016 01:01:31 +0100 Subject: [PATCH] [api] Make api log directory configurable. This change adds OBS_API_LOG_DIR configuration parameter to Makefile.include that specifies directory where api (and webui) logs will be written. Some distributions (like Fedora) have giudelines stating that logs should be written in /var/log directory. Signed-off-by: Oleg Girko <ol@infoserver.lv> --- Makefile.include | 1 + src/api/Makefile | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Makefile.include b/Makefile.include index b6b3f4c..c6f6281 100644 --- a/Makefile.include +++ b/Makefile.include @@ -8,6 +8,7 @@ OBS_BACKEND_DATA_DIR=/srv/obs OBS_BACKEND_LOG_DIR=$(OBS_BACKEND_DATA_DIR)/log OBS_DOCUMENT_ROOT=/srv/www/obs OBS_API_PREFIX=$(OBS_DOCUMENT_ROOT)/api +OBS_API_LOG_DIR=$(OBS_API_PREFIX)/log OBS_APIDOCS_PREFIX=$(OBS_DOCUMENT_ROOT)/docs OBS_FILLUP_DIR=/var/adm/fillup-templates OBS_FILLUP_FILE=sysconfig.obs-server diff --git a/src/api/Makefile b/src/api/Makefile index 2b677fe..bb8ff9f 100644 --- a/src/api/Makefile +++ b/src/api/Makefile @@ -7,6 +7,14 @@ OBS_API_BUNDLER_OPTS=BUNDLE_WITHOUT=test:assets:development BUNDLE_FROZEN=1 all: install: prepare_dirs prepare_rake docs config log_files build +ifneq ($(OBS_API_LOG_DIR),$(OBS_API_PREFIX)/log) + $(INSTALL) -d -m 755 $(DESTDIR)$(OBS_API_LOG_DIR) + test -n "`ls -A $(DESTDIR)$(OBS_API_PREFIX)/log`" && \ + mv $(DESTDIR)$(OBS_API_PREFIX)/log/* \ + $(DESTDIR)$(OBS_API_LOG_DIR) || : + rmdir $(DESTDIR)$(OBS_API_PREFIX)/log + ln -s $(OBS_API_LOG_DIR) $(DESTDIR)$(OBS_API_PREFIX)/log +endif prepare_dirs: $(INSTALL) -d -m 755 $(DESTDIR)$(OBS_API_PREFIX) -- 2.9.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor