Post by faeychildPost by Bit Twister# systemctl status mandriva-save-dmesg.service
● mandriva-save-dmesg.service - Save boot dmesg content
Loaded: loaded (/usr/lib/systemd/system/mandriva-save-dmesg.service; enabled; vendor preset: enabled)
Active: inactive (dead)
journalctl | grep save-dmesg
May 01 05:40:01 drakscanner[659325]: running: /bin/systemctl --quiet is-enabled mandriva-save-dmesg.service
May 01 05:40:08 drakscanner[659325]: running: /bin/systemctl --quiet is-enabled mandriva-save-dmesg.service
May 04 20:16:13 drakscanner[705679]: running: /bin/systemctl --quiet is-enabled mandriva-save-dmesg.service
May 04 20:16:19 drakscanner[705679]: running: /bin/systemctl --quiet is-enabled mandriva-save-dmesg.service
~]$ systemctl status mandriva-save-dmesg.service
● mandriva-save-dmesg.service - Save boot dmesg content
Loaded: loaded
(/usr/lib/systemd/system/mandriva-save-dmesg.service; enabled; vendor pres>
Active: inactive (dead)
I got a long pause here (4-5) seconds before the prompt returned with
nothing
Depends on size of journal and speed of system.
I have a new_boot_logs script to clear/truncate/delete log/journal files and reboot system.
# ls -l --all --escape --human-readable --color=auto' /var/log/journal/$(cat /etc/machine-id)
total 153M
drwxr-sr-x+ 2 root systemd-journal 24K May 4 22:08 .
drwxr-sr-x+ 3 root systemd-journal 4.0K Jan 14 14:01 ..
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 ***@688d8b538b6949b397c6928df9bf4ee2-0000000001953c37-0005de3b0c47acc3.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 5 00:17 system.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 5 00:16 user-1500.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1501.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1504.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 5 00:14 user-1508.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1510.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 5 00:14 user-1511.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1512.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1513.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1515.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1522.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1526.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1527.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1528.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1530.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1531.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1534.journal
-rw-r-----+ 1 root systemd-journal 8.0M May 4 22:08 user-1535.journal
Note no size limits set
# grep -v -e ^$ -e ^'#' /etc/systemd/journald.conf
[Journal]
ForwardToConsole=yes
TTYPath=/dev/tty12
new_boot_logs calls my new_journal script
# cat local/bin/new_journal
#!/bin/bash
#*******************************************************************************
#* new_journal - empty boot/application logs.
#*
#*
#* http://www.freedesktop.org/software/systemd/man/systemd-journald.service
#* flush logs and request immediate rotation of the journal files
#* then delete rotated files and all user logs.
#*
#* Usage: new_journal
#*
#*******************************************************************************
PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
#**********************************
#* remove any editor backup files
#**********************************
rm --force /etc/modprobe.d/*~
rm --force /etc/sysconfig/network-scripts/ifcfg-*~
type dovecot > /dev/null 2>&1
if [ $? -eq 0 ] ; then
systemctl --quiet is-active dovecot 2> /dev/null
if [ $? -eq 0 ] ; then
systemctl stop dovecot
fi
truncate -s 0 /var/log/dovecot/errors.log
fi
_log_dir=/var/log/journal/$(cat /etc/machine-id)
if [ -e $_log_dir ] ; then
echo "Wiping journal logs"
journalctl --rotate > /dev/null 2>&1
journalctl --vacuum-time=1s
sleep 2
rm --force $_log_dir/user-*.journal
rm --force $_log_dir/*@*
fi
type dovecot > /dev/null 2>&1
if [ $? -eq 0 ] ; then
systemctl --quiet is-enabled dovecot 2> /dev/null
if [ $? -eq 0 ] ; then
systemctl start dovecot
truncate -s 0 /var/log/dovecot/errors.log
fi
fi
pkill --full "fa --no-pager"
#************************ end new_journal ******************************