On Monday 12 June 2006 16:08, Wilson, David wrote:
> I ran the director in a shell and this was the output I received.
>
> bacula-dir: dird.c:128 Debug level = 1
> Traceback (most recent call last):
>   File "/etc/bacula/scripts/DirStartUp.py", line 6, in ?
>     import time, sys, bacula
> ImportError: /usr/lib/python2.3/lib-dynload/timemodule.so: undefined
> symbol: PyInt_FromLong
> bkup1-roc-dir: pythonlib.c:134 Python Import error.

Oh, it is nice that it worked.  I'll add that trick to the manual.  Note, once 
you get the DirStartUp script to load, Bacula should be able to print all the 
Python errors, so this trick, in principle, should not be necessary if/when 
you have problems later.

>
> It looks to be due to the fact I want to import the time module into the
> script.  Is there any reason why I shouldn't be able to use external
> modules??

Yes, you can perfectly well use external modules, in fact the "sys" module 
that the script calls is external.  The problem is that apparently, you have 
not loaded all parts of the Python time module.  I suggest you try writing a 
small external Python script that you call that does what you want -- running 
it directly with Python, then once you get it working, integrate it with 
Bacula.  Don't forget if you are running under root or some other user, 
Bacula may or may not have the right paths defined.

>
> David Wilson
> Network Security Engineer
> PAETEC Communications, Inc.
>
> -----Original Message-----
> From: Kern Sibbald [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 12, 2006 9:54 AM
> To: Wilson, David
> Cc: bacula-users@lists.sourceforge.net
> Subject: Re: [Bacula-users] Python Question
>
> On Monday 12 June 2006 14:15, Wilson, David wrote:
> > I just finished reading through the dev manual and I checked to make
> > sure that the following is true:
> >
> > 1. The director can write to the directory, and is creating a
> > DirStartUp.pyc file.
> > 2. Any functions I do not want have been removed, or the noop=1 has
>
> been
>
> > placed within the event.
> >
> > Is there any way to get more detail other than the error messages I am
> > seeing?  Seeing I cannot run the file from the command line to see if
>
> it
>
> > is syntax problem, it would be nice to find out why bacula cannot use
> > the file.
>
> Manually run the Director with the -d1 option on the command line in a
> shell
> window, and if you are lucky, the Python error message associated with
> the
> problem will be printed in the shell.
>
> Otherwise, start with the example files unchanged and make sure that the
>
> script file has totally open permissions.  That should get it working,
> afterwards you can make changes a bit at a time until you get what you
> want.
>
> > Thanks,
> >
> > David Wilson
> > Network Security Engineer
> > PAETEC Communications, Inc.
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Kern
> > Sibbald
> > Sent: Saturday, June 10, 2006 11:16 AM
> > To: bacula-users@lists.sourceforge.net
> > Cc: Wilson, David
> > Subject: Re: [Bacula-users] Python Question
> >
> > On Friday 09 June 2006 21:21, Wilson, David wrote:
> > > Greetings,
> > >
> > >
> > >
> > > I am working with using the python functionality of bacula and I am
> > > running into a problem with the DirStartUp.py script.
> > >
> > >
> > >
> > > Whenever I startup bacula, or restart the python engine I receive
>
> the
>
> > > following error:
> > >
> > >
> > >
> > > 09-Jun 15:14 bkup1-roc-dir: ERROR in pythonlib.c:131 Could not
>
> import
>
> > > Python script /etc/bacula/scripts/DirStartUp. Python disabled.
> > >
> > >
> > >
> > > When I attempt to run the script manually I receive:
> > >
> > > Traceback (most recent call last):
> > >
> > >   File "DirStartUp.py", line 6, in ?
> > >
> > >     import sys, bacula, time
> > >
> > > ImportError: No module named bacula
> > >
> > >
> > >
> > > I did compile bacula with -with-python and I received no errors
>
> while
>
> > > installing in.
> > >
> > >
> > >
> > > Any ideas??
> >
> > Please see the Python chapter of the development manual -- in
>
> particular
>
> > the
> > Python Configuration section. I have added several paragraphs that
> > explain
> > this problem.
> >
> > http://www.bacula.org/dev-manual/Python_Scripting.html
> >
> > > David Wilson
> > > Network Security Engineer
> > > PAETEC Communications, Inc.

-- 
Best regards,

Kern

  (">
  /\
  V_V


_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to