[systemd-devel] systemd-journald namespace persistence

Roger James roger at beardandsandals.co.uk
Wed Feb 9 10:18:22 UTC 2022


How do I create a persistent systemd-journald namespace?

I have a backup service that is run by a systemd timer. I would like that 
to use it's own namespace. I can create the namespace manually using 
systemctl start systemd-journald at mynamespace.service. However I cannot find 
a way to do that successfully at boot time. I have tried a RequiredBy and a 
Requires in the timer unit but neither seem to work.

Here are the relevant unit files.

/etc/systemd/journald at backup-and-csv.conf.d/backup-and-csv.conf

[Journal]
SystemMaxUse=1G
SystemKeepFree=5G
MaxRetentionSec=1day
MaxFileSec=1week

/etc/systemd/system/backup-and-csv.service

[Unit]
Description=InfluxDB incremental backup and csv service

[Service]
Type=oneshot
User=pi
WorkingDirectory=~
ExecStart=/home/pi/bin/backup-and-csv

/etc/systemd/system/backup-and-csv.timer

[Unit]
Description=backup-and-csv timer
Requires=systemd-journald at backup-and-csv.service
After=systemd-journald at backup-and-csv.service

[Timer]
OnBootSec=8min
OnUnitActiveSec=10min

[Install]
WantedBy=timers.target
#RequiredBy=systemd-journald at backup-and-csv.service

Any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220209/aa21584c/attachment.htm>


More information about the systemd-devel mailing list