systemctl cannot access service file, Permission denied
3
votes
1
answer
16557
views
On Fedora 35, I create my own service to schedule a backup. I have the script in /usr/local/bin/ and service files plus timer in /lib/systemd/system/
ls -an /usr/local/bin/ prints
-rwxr--r--. 1 0 0 3360 Dec 1 18:31 backup.sh
ls -an /lib/systemd/system/schedule-backup_root*
-rw-r--r--. 1 0 0 230 Dec 1 18:14 /lib/systemd/system/schedule-backup_root.service
-rw-r--r--. 1 0 0 388 Dec 1 16:49 /lib/systemd/system/schedule-backup_root.timer
but then when I start the service systemctl start schedule-backup_root.service
Dec 01 18:36:13 fallen-robot systemd: Started Nightly snapshot backup job for ROOT volume.
Dec 01 18:36:13 fallen-robot systemd: schedule-backup_root.service: Failed to locate executable /usr/local/bin/backup.sh: Permission denied
Dec 01 18:36:13 fallen-robot systemd: schedule-backup_root.service: Failed at step EXEC spawning /usr/local/bin/backup.sh: Permission denied
Dec 01 18:36:13 fallen-robot systemd: schedule-backup_root.service: Main process exited, code=exited, status=203/EXEC
Dec 01 18:36:13 fallen-robot systemd: schedule-backup_root.service: Failed with result 'exit-code'.
My service file looks like this:
[Unit]
Description=Nightly snapshot backup job for ROOT volume
[Service]
Type=simple
ExecStart=/usr/local/bin/backup.sh -s / -b /run/media/borko/BackupTest/ -t "Fallen Robot ROOT Backup Report"
[Install]
WantedBy=default.target
Why it cannot access the file?
Asked by Boris Hamanov
(245 rep)
Dec 2, 2021, 07:35 AM
Last activity: May 7, 2025, 05:31 PM
Last activity: May 7, 2025, 05:31 PM