Critical logs: move to /var/log/dlog 14/223314/4
authorMichal Bloch <m.bloch@samsung.com>
Tue, 28 Jan 2020 11:30:13 +0000 (12:30 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 3 Feb 2020 11:45:53 +0000 (12:45 +0100)
The writer binary now has the 'System' smack label to allow this.

Change-Id: I2f8486c02caa2e45cff5594b19d3155919ddd1e9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
packaging/dlog.spec
src/log-critical/log-critical.c

index 6665e45..8b6d4a6 100644 (file)
@@ -154,7 +154,7 @@ cp %{SOURCE101} .
 --enable-dynamic-filters
 %endif
 
-make %{?jobs:-j%jobs} CFLAGS+='-D__DLOG_VERSION=\"%{version}\" -D__DLOG_RELEASE=\"%{release}\" -DDLOG_CRITICAL_LOGFILE=\"/var/log/dlog_critical\"'
+make %{?jobs:-j%jobs} CFLAGS+='-D__DLOG_VERSION=\"%{version}\" -D__DLOG_RELEASE=\"%{release}\" -DDLOG_CRITICAL_LOGFILE=\"/var/log/dlog/critical\"'
 
 # autoconf adds a bunch of flags, including -O2.
 # Clear those so that test coverage can be measured properly
@@ -246,10 +246,10 @@ chsmack %{_bindir}/dlogctl -a "System::Tools"
 /sbin/ldconfig
 systemctl daemon-reload
 chsmack -a System /var/log/dlog
-touch /var/log/dlog_critical
-chmod 660 /var/log/dlog_critical
-chown log:log /var/log/dlog_critical
-chsmack -a '*' /var/log/dlog_critical
+touch /var/log/dlog/critical
+chmod 660 /var/log/dlog/critical
+chown log:log /var/log/dlog/critical
+chsmack -e 'System' %{_libexecdir}/dlog-log-critical
 
 %postun -n libdlog -p /sbin/ldconfig
 
index 4eb2cfe..7f22d27 100644 (file)
@@ -22,7 +22,7 @@
 #include <string.h>
 
 #ifndef DLOG_CRITICAL_LOGFILE
-       #define DLOG_CRITICAL_LOGFILE "/var/log/dlog_critical"
+       #define DLOG_CRITICAL_LOGFILE "/var/log/dlog/critical"
 #endif
 
 int main (int argc, char **argv)