1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/dbscripts/files/lastsync.service
Arun Bahl 8726084408 dbscripts: Ensure atomicity of lastsync file
We try to ensure an atomic operation of the lastsync file. This requires creating a tmp file which needs to be ignored.
This should take care of having empty lastsync files being served.
Possible cause is that the IO is stuck thus taking several seconds to write the lastsync timestamp.
This causes mirrors to download the empty file which causes checks to fail.
2024-07-20 15:17:47 +00:00

8 lines
167 B
SYSTEMD

[Unit]
Description=lastsync
[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c "date +%%s > /srv/ftp/lastsync.tmp && \
mv /srv/ftp/lastsync.tmp /srv/ftp/lastsync"