I have the following statement in bacula:
RunBeforeJob = "sudo /bin/mountpoint /backup/external || sudo /bin/mount /dev/mapper/bacula"
But it fails:
sudo: pam_unix(sudo:auth): conversation failed sudo: pam_unix(sudo:auth): auth could not identify password for [bacula] sudo: pam_succeed_if(sudo:auth): requirement "uid >= 1000" not met by user "bacula" sudo: bacula : command not allowed ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/mountpoint /backup/external || sudo /bin/mount /dev/mapper/bacula
I've found that bacula user can run one command in "RunBeforeJob" but cannot two commands. I don't understand why and how to fix it. I wonder that if I remove the pam restriction of "uid >=1000" it would work, but I'd like to find a better solution.
Note: I've disable requiretty in sudoers.