Hi,

07.11.2007 09:41,, Eric Böse-Wolf wrote::
> Today I switched from using an autochanger to using a single drive and
> updated the alert command to sh -c "tapeinfo -f /dev/sg1 | grep
> 'TapeAlert'" and now bacula complains about a bad alert command, as it
> exits with exit code 1.
> 
> Reading the man page of grep I noticed that it exits with exit code 1 if
> it does not find the pattern searched for, so I should have had the same
> error message with my autochanger, shouldn't I?
> 
> What's going on? Didn't bacula call the alert command with my
> autochanger? If it did and grep exited with code 0 it should have found
> the pattern and bacula should have noticed my about this, shouldn't it?
> 
> What do you think? Is it a good idea to write a shell script which
> exits with error code 0 if grep exits with either 0 or 1 and
> with code 1 if grep exits with code 2 (the actual code for an error
> in grep)?

I'd start with trying the actual tapealert command you run from Bacula 
executed from the shell. Run that as the user bacula-sd is run under.

There might be permission problems, for example, which don't get 
reported through the pipe.

Arno

> Yours sincerely,
> 
> Eric Böse-Wolf
> 
> PS.: Thank you Kern for writing Bacula. Besides being useful it is also
> a great toy ;-)
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users

-- 
Arno Lehmann
IT-Service Lehmann
www.its-lehmann.de

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to