We are using the Landscape client snap and noticed that its log files never rotate, which could lead to the device running out of storage over time. This behavior differs from the Debian package, where logrotate is used along with a SIGUSR1 signal sent to the Landscape service to trigger log rotation. (Refer to this file for details.)
We would like to request a mechanism for log rotation in the Landscape client snap.
landscape-client version
Name Version Rev Tracking Publisher Notes
landscape-client 24.08 334 latest/stable canonicalā -
Example log file size(Although its on DEBUG level, we still would like to rotate)
-rw-r--r-- 1 root root 6.2G Jan 7 07:29 broker.log
-rw-r--r-- 1 root root 8.1M Jan 7 07:37 manager.log
-rw-r--r-- 1 root root 15M Jan 7 07:35 monitor.log
-rw-r--r-- 1 root root 305K Jan 2 13:35 watchdog.log
Can have a look. Seems sensible a request so Iāll stick it in the backlog. Code base is the same between deb and snap so probably just need to propagate that signal into the snap somehow.
UbuntuCore does not ship logrotate since snaps usually log through journald which has internal ways of dealing with this.
If the snap writes its own logs to its own space you will likely need to stage logrotate into it and ship a systemd timer to have it run regularly with a specific config to rotate the logs in the snap owned space ā¦
The request seems sensible - Iāll stick it in the backlog and weāll have a look. As @ogra says we may have to look at options as we want to keep the snap and deb codebase the same as much as possible.
Although the snap logs stated that the service is started and deactivated in planned time frame.
2025-04-06T02:07:16Z systemd[1]: Started Service for snap application landscape-client.logrotate.
2025-04-06T02:07:16Z systemd[1]: snap.landscape-client.logrotate.service: Deactivated successfully.
Does it require being size limited before rotating? I have checked the config file you provided in the above commit, but couldnāt find it. Any idea?