d/t/logd: use journalctl to get logs instead of relying on $LOG
I've faced this autopkgtest failure in Ubuntu:
The logd test fails because the expected file /var/log/daemon.log is not present. This patch changes the test to rely on journalctl to access logs.
The logd test passes with the proposed changes:
autopkgtest [18:18:22]: test logd: [-----------------------
=== service ===
● logd.service - ha_logd logging daemon
Loaded: loaded (/lib/systemd/system/logd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-01-20 18:18:23 -03; 5ms ago
Docs: man:ha_logd(8)
Process: 1271 ExecStartPre=/bin/rm -f /run/logd.pid (code=exited, status=0/SUCCESS)
Main PID: 1272 (ha_logd)
Tasks: 2 (limit: 2307)
Memory: 664.0K
CGroup: /system.slice/logd.service
├─1272 ha_logd: read process
└─1273 ha_logd: write process
Jan 20 18:18:23 autopkgtest systemd[1]: Starting ha_logd logging daemon...
Jan 20 18:18:23 autopkgtest systemd[1]: Started ha_logd logging daemon.
Jan 20 18:18:23 autopkgtest logd[1272]: [1272]: info: logd started with /etc/logd.cf.
=== ha_logger ===
-- Journal begins at Thu 2020-11-12 10:26:59 -03, ends at Wed 2021-01-20 18:18:23 -03. --
Jan 20 18:18:23 autopkgtest cluster[1273]: [1277]: autopkgtest-message
=== logtest ===
sending Message 0
sending Message 1
sending Message 2
sending Message 3
sending Message 4
sending Message 5
sending Message 6
sending Message 7
sending Message 8
sending Message 9
-- Journal begins at Thu 2020-11-12 10:26:59 -03, ends at Wed 2021-01-20 18:18:23 -03. --
Jan 20 18:18:23 autopkgtest logtest[1273]: [1279]: info: total message dropped: 0
autopkgtest [18:18:23]: test logd: -----------------------]
autopkgtest [18:18:23]: test logd: - - - - - - - - - - results - - - - - - - - - -
logd PASS