Skip to content
Snippets Groups Projects
Commit 87260844 authored by pita strudl's avatar pita strudl :mount_fuji: Committed by pita strudl
Browse files

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.
parent 0fbbcf06
No related branches found
No related tags found
No related merge requests found
......@@ -3,5 +3,5 @@ Description=lastsync
[Service]
Type=oneshot
User=ftp
ExecStart=/usr/bin/bash -c "date +%%s > /srv/ftp/lastsync"
ExecStart=/usr/bin/bash -c "date +%%s > /srv/ftp/lastsync.tmp && \
mv /srv/ftp/lastsync.tmp /srv/ftp/lastsync"
......@@ -30,19 +30,19 @@ hosts deny = *
[ftp]
path = /srv/ftp
comment = ftp area (most mirrors should use this)
exclude = /archive/ /other/ /sources/ /*-debug/ /pool/*-debug/
exclude = /archive/ /other/ /sources/ /*-debug/ /pool/*-debug/ /lastsync.tmp
[ftp_tier1]
path = /srv/ftp
comment = ftp area (most mirrors should use this)
exclude = /archive/ /other/ /sources/ /*-debug/ /pool/*-debug/
exclude = /archive/ /other/ /sources/ /*-debug/ /pool/*-debug/ /lastsync.tmp
hosts allow = @@ALLOWHOSTS_TIER1@@
max connections = 0
[ftp_auth]
path = /srv/ftp
comment = ftp area, passworded (same as 'ftp')
exclude = /archive/ /other/ /sources/ /*-debug/ /pool/*-debug/
exclude = /archive/ /other/ /sources/ /*-debug/ /pool/*-debug/ /lastsync.tmp
hosts allow = *
auth users = *
secrets file = /etc/rsyncd.secrets
......@@ -52,19 +52,19 @@ hosts deny = *
[ftpfull]
path = /srv/ftp
comment = ftp area (everything, including very old versions, except sources)
exclude = /sources/
exclude = /sources/ /lastsync.tmp
[ftpfull_tier1]
path = /srv/ftp
comment = ftp area (everything, including very old versions, except sources)
exclude = /sources/
exclude = /sources/ /lastsync.tmp
hosts allow = @@ALLOWHOSTS_TIER1@@
max connections = 0
[ftpfull_auth]
path = /srv/ftp
comment = ftp area (everything, including very old versions, except sources)
exclude = /sources/
exclude = /sources/ /lastsync.tmp
hosts allow = *
auth users = *
secrets file = /etc/rsyncd.secrets
......@@ -74,17 +74,20 @@ hosts deny = *
[kitchensink]
path = /srv/ftp
comment = ftp area (everything, including very old versions)
exclude = /lastsync.tmp
hosts allow = {{ hostvars['archlinux.org']['ipv4_address'] }} {{ hostvars['archlinux.org']['ipv6_address'] }}
[kitchensink_tier1]
path = /srv/ftp
comment = ftp area (everything, including very old versions)
exclude = /lastsync.tmp
hosts allow = @@ALLOWHOSTS_TIER1@@ {{ hostvars['gemini.archlinux.org']['ipv4_address'] }} {{ hostvars['gemini.archlinux.org']['ipv6_address'] }} {{ hostvars['repos.archlinux.org']['ipv4_address'] }} {{ hostvars['repos.archlinux.org']['ipv6_address'] }}
max connections = 0
[kitchensink_auth]
path = /srv/ftp
comment = ftp area (everything, including very old versions)
exclude = /lastsync.tmp
hosts allow = *
auth users = *
secrets file = /etc/rsyncd.secrets
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment