Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
d00a59ac
Commit
d00a59ac
authored
Jan 17, 2021
by
Morten Linderud
🏄
Committed by
Kristian Klausen
Feb 04, 2022
Browse files
Added syncdebug role
Signed-off-by:
Morten Linderud
<
morten@linderud.pw
>
parent
194bc84b
Changes
5
Hide whitespace changes
Inline
Side-by-side
roles/dbscripts/templates/rsyncd.conf.proto.j2
View file @
d00a59ac
...
...
@@ -91,6 +91,15 @@ hosts deny = *
secrets file = /etc/rsyncd.secrets
max connections = 0
# Debug repositories
[debug_packages]
path = /srv/ftp
comment = debug packages
exclude = *
include = /pool /pool/*-debug/***
hosts allow = {{ hostvars['debuginfod.archlinux.org']['ipv4_address'] }} {{ hostvars['debuginfod.archlinux.org']['ipv6_address'] }}
max connections = 0
# Individual repositories
[core]
path = /srv/ftp/core
...
...
roles/syncdebug/files/syncdebug
0 → 100755
View file @
d00a59ac
#!/bin/bash
target
=
"/srv/ftp"
lock
=
"/var/lock/syncdebug.lck"
source_url
=
'rsync://rsync.archlinux.org/debug_packages'
lastupdate_url
=
'https://rsync.archlinux.org/lastupdate'
[
!
-d
"
${
target
}
"
]
&&
mkdir
-p
"
${
target
}
"
exec
9>
"
${
lock
}
"
flock
-n
9
||
exit
rsync_cmd
()
{
local
-a
cmd
=(
rsync
-rlptH
--safe-links
--delete-delay
--delay-updates
"--timeout=600"
"--contimeout=60"
--no-motd
)
if
stty
&>/dev/null
;
then
cmd+
=(
-h
-v
--progress
)
else
cmd+
=(
"--info=name1"
)
fi
"
${
cmd
[@]
}
"
"
$@
"
}
# if we are called without a tty (cronjob) only run when there are changes
if
!
tty
-s
&&
[[
-f
"
$target
/lastupdate"
]]
&&
diff
-b
<
(
curl
-Ls
"
$lastupdate_url
"
)
"
$target
/lastupdate"
>
/dev/null
;
then
exit
0
fi
rsync_cmd
\
--exclude
=
".well-known"
\
"
${
source_url
}
"
\
"
${
target
}
"
roles/syncdebug/files/syncdebug.service
0 → 100644
View file @
d00a59ac
[Unit]
Description
=
Synchronize debug packages
RequiresMountsFor
=
/srv/ftp
Wants
=
network-online.target
After
=
network-online.target
[Service]
Type
=
oneshot
ExecStart
=
/usr/local/bin/syncdebug
Nice
=
19
IOSchedulingClass
=
best-effort
IOSchedulingPriority
=
7
roles/syncdebug/files/syncdebug.timer
0 → 100644
View file @
d00a59ac
[Unit]
Description=Sync debug packages every 4 hours
[Timer]
OnCalendar=00/4:00
AccuracySec=1m
Persistent=true
[Install]
WantedBy=timers.target
roles/syncdebug/tasks/main.yml
0 → 100644
View file @
d00a59ac
---
-
name
:
install rsync
pacman
:
name=rsync state=present
-
name
:
install syncdebug script
copy
:
src=syncdebug dest=/usr/local/bin/syncdebug owner=root group=root mode=0755
-
name
:
install syncdebug units
copy
:
src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
with_items
:
-
syncdebug.timer
-
syncdebug.service
-
name
:
start and enable syncdebug units
systemd
:
name
:
"
{{
item
}}"
enabled
:
true
state
:
started
daemon_reload
:
true
with_items
:
-
syncdebug.timer
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment