Enabling and Disabling pmlogd
From webOS OSE 2.1.0, journald is the default logging system on systemd, which means journald is enabled instead of pmlogd. To enable pmlogd, you must go through manual process to create required files and disable journald.
This page describes the following:
- How to check the status of the logging system
- How to enable pmlogd instead of journald
- How to re-enable journald
Checking which logging system you are using
You can figure out which logging system is enabled by checking the status of the logging daemon and the logging file.
journald (default)
Check the status of
systemd-journald.service
root@raspberrypi4:/# systemctl status systemd-journald.service | tee * systemd-journald.service - Journal Service Loaded: loaded (/lib/systemd/system/systemd-journald.service; static) Active: active (running) since Thu 2022-04-28 10:42:25 PDT; 1 year 6 months ago TriggeredBy: * systemd-journald.socket * systemd-journald-dev-log.socket * systemd-journald-audit.socket Docs: man:systemd-journald.service(8) man:journald.conf(5) Main PID: 126 (systemd-journal) Status: "Processing requests..." Tasks: 1 (limit: 8797) CPU: 2.059s CGroup: /system.slice/systemd-journald.service `- 126 /lib/systemd/systemd-journald
Check the logging file:
/run/log/journal
directoryroot@raspberrypi4:/# ls /run/log/journal/ f85b5eef84bf41f886bc544d5419d3ea
pmlogd (optional)
Check the status of
pm-log-daemon.service
root@raspberrypi4-64:~# systemctl status pm-log-daemon.service | tee * pm-log-daemon.service - webos - "pm-log-daemon.service" Loaded: loaded (/etc/systemd/system/pm-log-daemon.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2022-04-28 10:42:28 PDT; 1 year 6 months ago Process: 401 ExecStartPre=/bin/mkdir -p /tmp/pmlogdaemon (code=exited, status=0/SUCCESS) Process: 409 ExecStartPost=/bin/touch /tmp/pmlogdaemon/hub-ready (code=exited, status=0/SUCCESS) Main PID: 408 (PmLogDaemon) Tasks: 2 (limit: 8797) CPU: 474ms CGroup: /system.slice/pm-log-daemon.service `- 408 /usr/sbin/PmLogDaemon -z -f 6 -m
Check the logging file :
/var/log/messages*
fileroot@raspberrypi4:/# ls /var/log/messages* /var/log/messages
How to enable pmlogd
This section describes the steps required to enable pmlogd instead of journald.
Step 1. Remove overlay mount
Delete the overlay mount related configuration file.
root@raspberrypi4:/# rm /var/luna/preferences/mount_overlay_enabled
root@raspberrypi4:/# reboot
Step 2. Create systemd files for pmlogd
First, remount the file system as rw mode.
root@raspberrypi4:/# mount -o remount,rw /
Second, create systemd files for pmlogd.
pm-log-daemon.service
pm-klog-daemon.service
pm-log-daemon-stop.sh
pm-log-daemon.service
root@raspberrypi4:/# vi /etc/systemd/system/pm-log-daemon.service
/etc/systemd/system/pm-log-daemon.service |
---|
|
pm-klog-daemon.service
root@raspberrypi4:/# vi /etc/systemd/system/pm-klog-daemon.service
/etc/systemd/system/pm-klog-daemon.service |
---|
|
pm-log-daemon-stop.sh
root@raspberrypi4:/# vi /etc/systemd/system/scripts/pm-log-daemon-stop.sh
root@raspberrypi4:/# chmod +x /etc/systemd/system/scripts/pm-log-daemon-stop.sh
/etc/systemd/system/scripts/pm-log-daemon-stop.sh |
---|
|
Step 3. Create symbolic link files
Create symbolic link files to the pmlogd logging daemons.
root@raspberrypi4:/# cd /etc/systemd/system/multi-user.target.wants
root@raspberrypi4:/# ln -sf ../pm-log-daemon.service pm-log-daemon.service
root@raspberrypi4:/# ln -sf ../pm-klog-daemon.service pm-klog-daemon.service
Step 4. Disable journald
To disable journald, execute the following commands.
root@raspberrypi4:/# ln -sf /dev/null /etc/systemd/system/systemd-journal-catalog-update.service
root@raspberrypi4:/# ln -sf /dev/null /etc/systemd/system/systemd-journal-flush.service
root@raspberrypi4:/# ln -sf /dev/null /etc/systemd/system/systemd-journald.service
root@raspberrypi4:/# rm /lib/systemd/system/multi-user.target.wants/backup-log.service
Step 5. Restore overlay mount and Reboot
Restore overlay mount and reboot the target.
root@raspberrypi4:/# touch /var/luna/preferences/mount_overlay_enabled
root@raspberrypi4:/# sync
root@raspberrypi4:/# reboot
How to re-enable journald
This section describes the steps required to re-enable journald after pmlogd has been enabled.
Step 1. Remove overlay mount
root@raspberrypi4:/# rm /var/luna/preferences/mount_overlay_enabled
root@raspberrypi4:/# reboot
Step 2. Remove pmlogd files
First, remount the file system as rw mode.
root@raspberrypi4:/# mount -o remount,rw /
Second, remove files that are related to pmlogd.
root@raspberrypi4:/# rm /etc/systemd/system/multi-user.target.wants/pm-*
Step 3. Enable journald
To enable journald, execute the following commands.
root@raspberrypi4:/# rm /etc/systemd/system/systemd-journal*
root@raspberrypi4:/# ln -sf /lib/systemd/system/backup-log.service /lib/systemd/system/multi-user.target.wants/backup-log.service
Step 4. Restore overlay mount and Reboot
Restore overlay mount and reboot the target.
root@raspberrypi4:/# touch /var/luna/preferences/mount_overlay_enabled
root@raspberrypi4:/# sync
root@raspberrypi4:/# reboot