Hi,

29.10.2007 18:09,, Rich wrote::
> On 2007.10.27. 17:27, Arno Lehmann wrote:
> ...
>>> 2. if "Scripts Directory" is specified in director configuration file, 
>>> director can't be stopped with ctrl+c, when run in foreground;
>> I don't know if this qualifies as a bug - because, in normal 
>> circumstances, you should only run the DIR in foreground under the 
>> debugger (Kern says ;-) - but I don't think this is serious.
> 
> yeah, but consistency and obeying ctrl+c in foreground are good ;)

True, but given the relatively low impact of this you'll have to be 
good at nagging Kern into fixing it - or do it yourself :-)

> ...
>>> 1. the example is using both lines with spacing and without spacing 
>>> around equal sign (a=b and a = b). which would be a better style choice ?
>> I prefer the spaces around operators because it creates much better 
>> readability. Others disagree.
> 
> actually, i don't care that much about the method used as for it being 
> consistent in the example script :)

Good point. But then, especially given this discussion, I get the 
impression the python scripting chapter needs a major rework anyway...

> ...
>>> 4. does somebody have example on writing out datetime string that would 
>>> reproduce behaviour that label format currently produces for 
>>> "${Year}.${Month:p/2/0/r}.${Day:p/2/0/r}-${Hour:p/2/0/r}.${Minute:p/2/0/r}" 
>>> ?
>> Again, no examples, manuals, or even working code, but something like
>>
>> import datetime
> 
> and this is where it breaks.
> just adding that line to the script prevents director from starting at all :
> 
> Fatal Python error: Interpreter not initialized (version mismatch?)

That looks like a python problem... or something related to the way 
python is embedded into Bacula. You should consider a bug report at 
bugs.bacula.org, and point out that this might be a configure or 
linking problem, or even one of finding the right python module path.

Currently, I have no idea how to fix or further diagnose this.

> Kaboom! bacula-dir, backup_1-dir got signal 6 - IOT trap. Attempting 
> traceback.
> Kaboom! exepath=/sbin/
> Calling: /sbin/btraceback /sbin/bacula-dir 32340
> execv: /sbin/btraceback failed: ERR=No such file or directory
> Traceback complete, attempting cleanup ...
> Orphaned buffer:  backup_1-dir     16 bytes buf=820b150 allocated at 
> watchdog.c:86
> Orphaned buffer:  backup_1-dir     16 bytes buf=82330a8 allocated at 
> watchdog.c:87
> 
> 
> on #python, it was suggested that :
> "that error is caused by importing a module compiled for a different 
> version of Python, on Windows."
> 
> but i don't understand how could that be possible
> 
> where could the problem be ?

configure, linking, module path - I suppose you need to be good with 
software building and gdb to find a solution here.

> ...
>>> 5. a (slightly modified) line reads :
>>> job.JobReport = "Exists=%d %s" % (job.DoesVolumeExist(Vol), Vol)
>>>
>>> if i understand correctly, it would only add a line to the report and 
>>> proceed, right ?
>> Yup.
>>
>>> it seems that in such a case job simply stucks, waiting for a manual 
>>> volume specification.
>>> can i make a check that would error out if such a volume already exists ?
>> Sure. Check the volume name you just created using DoesVolumeExist, 
>> and if it already exists, append or modify a suffix and loop. 
>> Otherwise, continue.
> 
> actually, i would prefer to error out in such a case - if volume exists, 
> something's broken.

Well, relying onto the number of volumes in a pool is not safe, for 
example. Imagine you have volumes V1, V2, V4 in a pool and label with 
'V'+number. The next volume will be the fourth one, so you'd end up 
with V4 a second time.

As this can happen easily when you delete volumes, precautions are 
important.

> looking over the example, i could not find a way to cancel the job - how 
> would i do that ?

I don't know - perhaps return the null value from the method. You'll 
have to try :-)

>> Hope this helps,
> 
> it did a lot, huge thanks.
> i hope that the result of my pain will help somebody else :)

Definitely... at least me. If I find the time, I'll play with python 
scripting. Perhaps even this year or 2008 ;-)

Arno


>> Arno

-- 
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