dlog_logger isn't installed if the current backend is journal. 22/58622/1 accepted/tizen/ivi/20160218.023809 accepted/tizen/mobile/20160203.050652 accepted/tizen/tv/20160203.050711 accepted/tizen/wearable/20160203.050729 submit/tizen/20160202.085236 submit/tizen_common/20160218.142243 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000003
authorKichan Kwon <k_c.kwon@samsung.com>
Tue, 2 Feb 2016 08:42:34 +0000 (17:42 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Tue, 2 Feb 2016 08:42:34 +0000 (17:42 +0900)
 dlog_logger dumps logs "from kernel buffer" onto disk,
so systemd-journal which uses user-level buffer doesn't have to use this.

Change-Id: I14d0de6f8e1919b24c4cf839e86f02d9a03906f6
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Makefile.am
configure.ac
packaging/dlog.spec

index c31992a..9d2ddf8 100755 (executable)
@@ -54,23 +54,11 @@ dlogutil_SOURCES = \
        include/log_file.h \
        include/logprint.h
 
-bin_PROGRAMS += dlog_logger
 sbin_PROGRAMS = dloginit
 
-dloginit_CFLAGS =  \
-       $(AM_CFLAGS) \
-       $(LIBUDEV_CFLAGS) \
-       -fPIE
-
-dloginit_LDFLAGS = \
-       $(AM_LDFLAGS) \
-       $(LIBUDEV_LIBS) \
-       -pie
+if !WITH_SYSTEMD_JOURNAL
 
-dloginit_SOURCES = \
-       src/loginit/loginit.c \
-       include/logcommon.h \
-       include/dlog.h
+bin_PROGRAMS += dlog_logger
 
 dlog_logger_CFLAGS =  \
        $(AM_CFLAGS) \
@@ -93,6 +81,23 @@ dlog_logger_SOURCES = \
        include/log_file.h \
        include/logprint.h
 
+endif
+
+dloginit_CFLAGS =  \
+       $(AM_CFLAGS) \
+       $(LIBUDEV_CFLAGS) \
+       -fPIE
+
+dloginit_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       $(LIBUDEV_LIBS) \
+       -pie
+
+dloginit_SOURCES = \
+       src/loginit/loginit.c \
+       include/logcommon.h \
+       include/dlog.h
+
 include/%: include/%.m4
        m4 -P $(M4_DEFINES) < $< > $@
 
index 4aef358..6bd3321 100755 (executable)
@@ -34,6 +34,7 @@ if test "x$with_systemd_journal" != "xno"; then
        fi
 fi
 AM_CONDITIONAL(HAVE_SYSTEMD_JOURNAL, [test "x$have_systemd_journal" = "xyes"])
+AM_CONDITIONAL(WITH_SYSTEMD_JOURNAL, [test "x$with_systemd_journal" = "xyes"])
 if test "x$have_systemd_journal" = "xyes" ; then
        systemd_journal=systemd-journal
 fi
index d9c2731..657d277 100755 (executable)
@@ -85,6 +85,9 @@ cp %{SOURCE102} .
 %autogen --disable-static
 %configure --disable-static \
                        --enable-fatal_on \
+               %if %{?backend_journal} == ON
+                       --enable-journal \
+               %endif
                        --enable-engineer_mode
 make %{?jobs:-j%jobs} \
        CFLAGS+=-DKMSG_DEV_CONFIG_FILE=\\\"/run/dloginit.conf\\\" \
@@ -110,6 +113,9 @@ mkdir -p %{buildroot}/opt/etc
 cp %SOURCE201 %{buildroot}/opt/etc/dlog.conf
 
 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants/
+
+%if %{?backend_journal} == OFF
+
 install -m 0644 %SOURCE301 %{buildroot}%{_unitdir}
 
 %if %{?backend_kmsg} == ON
@@ -123,6 +129,8 @@ ln -s ../dlog_logger.path %{buildroot}%{_unitdir}/multi-user.target.wants/dlog_l
 # default set log output to external files
 cp %SOURCE202 %{buildroot}/opt/etc/dlog_logger.conf
 
+%endif
+
 mkdir -p %{buildroot}%{_unitdir}/sysinit.target.wants/
 install -m 0644 %SOURCE401 %{buildroot}%{_unitdir}
 ln -s ../dloginit.service %{buildroot}%{_unitdir}/sysinit.target.wants/dloginit.service
@@ -167,12 +175,14 @@ systemctl daemon-reload
 %attr(750,log,log) %{_bindir}/dlogutil
 %attr(755,log,log) %{_bindir}/dlogctrl
 %attr(755,log,log) /var/log/dlog
+%{_udevrulesdir}/01-dlog.rules
+%if %{?backend_journal} == OFF
 %attr(750,log,log) %{_bindir}/dlog_logger
 %attr(664,log,log) /opt/etc/dlog_logger.conf
 %{_unitdir}/dlog_logger.service
 %{_unitdir}/dlog_logger.path
 %{_unitdir}/multi-user.target.wants/dlog_logger.path
-%{_udevrulesdir}/01-dlog.rules
+%endif
 
 %files  -n libdlog
 %manifest libdlog.manifest