Get journal api wrapper working for detailed logs
This commit is contained in:
BIN
additional/journalwrap
Executable file
BIN
additional/journalwrap
Executable file
Binary file not shown.
@@ -291,7 +291,7 @@ p.cssvalid,p.htmlvalid {float:left;margin-right:20px}
|
|||||||
padding: 1em;
|
padding: 1em;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
font-family: monospace, monospace;
|
font-family: monospace, monospace;
|
||||||
font-size: 0.95em;
|
font-size: 0.75em;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
@@ -94,7 +94,7 @@ if (!$pid || $pid < 1) {
|
|||||||
|
|
||||||
// Journal retrieval using C wrapper
|
// Journal retrieval using C wrapper
|
||||||
define('FFI_LIB', 'libjournalwrap.so'); // adjust if needed
|
define('FFI_LIB', 'libjournalwrap.so'); // adjust if needed
|
||||||
define('WRAPPER_BIN', '/usr/local/bin/journalwrap'); // fallback executable path
|
define('WRAPPER_BIN', '/usr/bin/journalwrap'); // fallback executable path
|
||||||
define('MAX_OUTPUT_BYTES', 2_000_000); // 2MB safety cap
|
define('MAX_OUTPUT_BYTES', 2_000_000); // 2MB safety cap
|
||||||
|
|
||||||
function getJournalByPidViaFFI(int $pid): ?string {
|
function getJournalByPidViaFFI(int $pid): ?string {
|
||||||
|
@@ -13,6 +13,9 @@ License: GPL
|
|||||||
Group: SME/addon
|
Group: SME/addon
|
||||||
Source: %{name}-%{version}.tgz
|
Source: %{name}-%{version}.tgz
|
||||||
|
|
||||||
|
%global _binaries_in_noarch_packages_terminate_build 0
|
||||||
|
%global debug_package %{nil}
|
||||||
|
|
||||||
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
|
||||||
BuildArchitectures: noarch
|
BuildArchitectures: noarch
|
||||||
Requires: smeserver-release => 9.0
|
Requires: smeserver-release => 9.0
|
||||||
@@ -35,6 +38,57 @@ AutoReqProv: no
|
|||||||
A script that via cron.d e-mails mail statistics to admin on a daily basis.
|
A script that via cron.d e-mails mail statistics to admin on a daily basis.
|
||||||
See https://wiki.koozali.org/mailstats
|
See https://wiki.koozali.org/mailstats
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup
|
||||||
|
|
||||||
|
%build
|
||||||
|
perl createlinks
|
||||||
|
|
||||||
|
%install
|
||||||
|
/bin/rm -rf $RPM_BUILD_ROOT
|
||||||
|
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
|
||||||
|
chmod +x $RPM_BUILD_ROOT/usr/bin/runmailstats.sh
|
||||||
|
|
||||||
|
#chmod 0640 $RPM_BUILD_ROOT/etc/mailstats/db.php
|
||||||
|
#ls -l /builddir/build/BUILDROOT/smeserver-mailstats-11.1-5.el8.sme.x86_64/etc/mailstats/
|
||||||
|
#chown root:102 $RPM_BUILD_ROOT/etc/mailstats/db.php
|
||||||
|
|
||||||
|
# Define the placeholder and generate the current date and time
|
||||||
|
now=$(date +"%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
|
# Replace the placeholder in the Python program located at %{BUILDROOT}/usr/bin
|
||||||
|
sed -i "s|__BUILD_DATE_TIME__|$now|" $RPM_BUILD_ROOT/usr/bin/mailstats.py
|
||||||
|
|
||||||
|
/bin/rm -f %{name}-%{version}-filelist
|
||||||
|
/sbin/e-smith/genfilelist --file '/etc/mailstats/db.php' 'attr(0640, root, apache)' $RPM_BUILD_ROOT | grep -v "\.pyc" | grep -v "\.pyo" > %{name}-%{version}-filelist
|
||||||
|
|
||||||
|
install -Dpm 0755 journalwrap %{buildroot}%{_bindir}/journalwrap
|
||||||
|
#install -Dpm 0644 libjournalwrap.so %{buildroot}%{_libdir}/libjournalwrap.so
|
||||||
|
|
||||||
|
|
||||||
|
%pre
|
||||||
|
/usr/bin/pip3 install -q pymysql
|
||||||
|
/usr/bin/pip3 install -q numpy
|
||||||
|
/usr/bin/pip3 install -q pandas
|
||||||
|
|
||||||
|
%clean
|
||||||
|
/bin/rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%files -f %{name}-%{version}-filelist
|
||||||
|
%defattr(-,root,root)
|
||||||
|
#%attr(0640, root, apache) %config(noreplace) /etc/mailstats/db.php
|
||||||
|
%{_bindir}/journalwrap
|
||||||
|
|
||||||
|
#%{_libdir}/libjournalwrap.so
|
||||||
|
|
||||||
|
|
||||||
|
%post
|
||||||
|
/sbin/ldconfig
|
||||||
|
usermod -aG systemd-journal www
|
||||||
|
|
||||||
|
%postun
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Sep 02 2025 Brian Read <brianr@koozali.org> 11.1-5.sme
|
* Tue Sep 02 2025 Brian Read <brianr@koozali.org> 11.1-5.sme
|
||||||
- Speed up Journal access [SME: 13121]
|
- Speed up Journal access [SME: 13121]
|
||||||
@@ -127,38 +181,4 @@ See https://wiki.koozali.org/mailstats
|
|||||||
- Add Update event to createlinks Unexpected failure string in log file: auth::auth_cvm_unix_local see [SME 7089]
|
- Add Update event to createlinks Unexpected failure string in log file: auth::auth_cvm_unix_local see [SME 7089]
|
||||||
|
|
||||||
* Sat May 26 2012 Brian J read <brianr@bjsystems.co.uk> 1.0-1.sme
|
* Sat May 26 2012 Brian J read <brianr@bjsystems.co.uk> 1.0-1.sme
|
||||||
- Initial version
|
- Initial version
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup
|
|
||||||
|
|
||||||
%build
|
|
||||||
perl createlinks
|
|
||||||
|
|
||||||
%install
|
|
||||||
/bin/rm -rf $RPM_BUILD_ROOT
|
|
||||||
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
|
|
||||||
chmod +x $RPM_BUILD_ROOT/usr/bin/runmailstats.sh
|
|
||||||
#chmod 0640 $RPM_BUILD_ROOT/etc/mailstats/db.php
|
|
||||||
#ls -l /builddir/build/BUILDROOT/smeserver-mailstats-11.1-5.el8.sme.x86_64/etc/mailstats/
|
|
||||||
#chown root:102 $RPM_BUILD_ROOT/etc/mailstats/db.php
|
|
||||||
# Define the placeholder and generate the current date and time
|
|
||||||
now=$(date +"%Y-%m-%d %H:%M:%S")
|
|
||||||
|
|
||||||
# Replace the placeholder in the Python program located at %{BUILDROOT}/usr/bin
|
|
||||||
sed -i "s|__BUILD_DATE_TIME__|$now|" $RPM_BUILD_ROOT/usr/bin/mailstats.py
|
|
||||||
|
|
||||||
/bin/rm -f %{name}-%{version}-filelist
|
|
||||||
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT | grep -v "\.pyc" | grep -v "\.pyo" > %{name}-%{version}-filelist
|
|
||||||
|
|
||||||
%pre
|
|
||||||
/usr/bin/pip3 install -q pymysql
|
|
||||||
/usr/bin/pip3 install -q numpy
|
|
||||||
/usr/bin/pip3 install -q pandas
|
|
||||||
|
|
||||||
%clean
|
|
||||||
/bin/rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files -f %{name}-%{version}-filelist
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%attr(0640, root, apache) %config(noreplace) /etc/mailstats/db.php
|
|
Reference in New Issue
Block a user