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@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@xxxxxxxxxxxxxxxxxxx.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@backup-and-csv.service
After=systemd-journald@backup-and-csv.service
[Timer]
_OnBootSec_=8min
_OnUnitActiveSec_=10min
[Install]
WantedBy=timers.target
#RequiredBy=systemd-journald@backup-and-csv.service
Any ideas?