0

I've got a handful of bash scripts (all essentially clones of each other) which each does an rsync to a different dnf/yum repo to pull that repo down to our local mirror. The scripts all run correctly when run manually (as root).

I've also got a systemd unit/service file (below) with a corresponding timer file. This is all working correctly in terms of the timer fires and the service runs. However, when the service runs (via the timer or manually as root) I get the below error (from the log of one of the scripts - each script is reporting the same error).

Can anyone please tell me where I'm going wrong? Thanks.

Unit File

[Unit]
Description=Sync the local DNF mirror server with upstream repo servers
Wants=network-online.target
After=multi-user.target

[Service]
Type=oneshot
User=root
ExecStart=/etc/rsync.d/sync_ceph_repos.sh
ExecStart=/etc/rsync.d/sync_elrepo_repos.sh
ExecStart=/etc/rsync.d/sync_epel_repos.sh
ExecStart=/etc/rsync.d/sync_gf_repos.sh
ExecStart=/etc/rsync.d/sync_nginx_repos.sh
ExecStart=/etc/rsync.d/sync_remi_repos.sh
ExecStart=/etc/rsync.d/sync_rocky_repos.sh

[Install]
WantedBy=multi-user.target

Error message From Logs

rsync: [Receiver] failed to connect to mirror.digitalpacific.com.au (101.0.120.90): Permission denied (13)
rsync error: error in socket IO (code 10) at clientserver.c(138) [Receiver=3.2.3]
rsync: [Receiver] failed to connect to mirror.digitalpacific.com.au (101.0.120.90): Permission denied (13)
rsync error: error in socket IO (code 10) at clientserver.c(138) [Receiver=3.2.3]
0

1 Answer 1

0

I assume your service is Sync.service so ... ausearch -c 'Sync' --raw | audit2allow -M my-Sync semodule-i my-Sync.pp

Then try executing again as 'systemctl start Sync.service' If that fails, rinse/repeat. You are iterating through permission changes to the SElinux system. Hope someone has a better answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .