You are not logged in.
Pages: 1
Hi All,
I am running into a strange problem, which I can figure out.
I am using dcron to backup my data. Before starting the rsync-commands in the backup-script my backup drive is mounted by executing the following code:
/usr/bin/udisks --mount /dev/disk/by-uuid/uid_string
The script and the cronjob are run as a normal user, but I keep getting the following message
Mount failed: Not Authorized
I tried to add the command as a separate cronjob, but again the same error
Strangely, I can run the script without problems, but when called as a cronjob it fails to mount the disk. All other actions in the backup-script run without problems.
It is clearly a permission thing, but I can't figure out how and why...
Last edited by lantald (2011-11-24 15:10:51)
Offline
Which user are you using to run the script, yours or a generic system account (like "backup")?
Check the user's groups; your user may be a part of a group that will allow you to mount the volume and run the script, but the user you have set dcron to run the task as may not be in those groups.
Offline
udisks relies on policykit and consolekit, which implements the idea of a "seat". I'll try to make this succinct -- while you're literally sitting at your computer, you have the active seat, giving you the ability to perform some root-like tasks without actually being root. Your cron session does not have this active seat, and therefore is not authorized to perform these tasks.
Either run the backup as root, or leave the drive mounted.
Offline
Thanks for the replies! I was already considering policykit & consolekit, but could not figure why and how...
I am running the cronjobs as myself (user) and can mount the disk as this user. But if I understand Falconindy correctly, cronjobs are run in another seat as the user would normally use. However, I fail to understand why this is the case. Why would you want a regular user to have different permissions when he (or she) is scheduling tasks? Is there really no other way around this than to mount the disk as root?
Offline
Solved the problem by adding the disk to fstab
and using
/bin/mount
instead of
/usr/bin/udisks --mount
in my backup script.
Last edited by lantald (2011-11-24 20:00:38)
Offline
Pages: 1