Bacula-users

Re: [Bacula-users] RunBeforeJob get stuck .. sometimes ..

2008-07-22 17:38:19
Subject: Re: [Bacula-users] RunBeforeJob get stuck .. sometimes ..
From: "Jeremy Koppel" <jkoppel AT bluecanopy DOT com>
To: "Arno Lehmann" <al AT its-lehmann DOT de>, "bacula-users AT lists.sourceforge DOT net" <bacula-users AT lists.sourceforge DOT net>
Date: Tue, 22 Jul 2008 17:38:10 -0400

You're both right - I've done some tests and the backupComplete.bash script exits successfully if I comment out the line starting Alfresco.  Also, while if I run /etc/bacula/customScripts/backupComplete.bash from the command line, it is successful, if I start it from a cron job, I get a zombie, and see the same behavior as if I'd started it from Bacula.  So, not a Bacula issue.

 

The zombie has no children, and running nohup'ed and backgrounded doesn't give me different output.  We definitely need to do something different to restart Alfresco.  Found this on the Gentoo site: 

Do not use the init script provided by the service if it isn't explicitly written for Gentoo: Gentoo's init scripts are not compatible with the init scripts used by other distributions!

Thanks for your input!

 

--Jeremy

 

 

-----Original Message-----
From: bacula-users-bounces AT lists.sourceforge DOT net [mailto:bacula-users-bounces AT lists.sourceforge DOT net] On Behalf Of Arno Lehmann
Sent: Tuesday, July 22, 2008 2:23
To: bacula-users AT lists.sourceforge DOT net
Subject: Re: [Bacula-users] RunBeforeJob get stuck .. sometimes ..

 

Hello,

 

21.07.2008 17:48, Tilman Schmidt wrote:

> Jeremy Koppel schrieb:

>

>> The script: /etc/bacula/customScripts/backupComplete.bash:

>> 

>> #!/bin/bash

>> #

>> # This script fires after Alfresco backup is complete.

>> 

>> source /etc/profile

>> /etc/init.d/alfresco start

>> echo "This was echoed from the bacula script."

>> 

>> Bacula log:

>> 

>> 20-Jul 21:20 ns2-sd: Volume "AAA017L2" previously written, moving to

>> end of data.

>> 20-Jul 21:21 ns2-sd: Ready to append to end of Volume "AAA017L2" at

>> file=9.

>> 20-Jul 21:32 bckm1-fd: ClientAfterJob: run command

>> "/etc/bacula/customScripts/backupComplete.bash"

>> 20-Jul 21:32 bckm1-fd: ClientAfterJob: Starting OpenOffice service ...

>> 20-Jul 21:32 bckm1-fd: ClientAfterJob: Starting Alfresco ...

>> 20-Jul 21:32 bckm1-fd: ClientAfterJob: This was echoed from the bacula

>> script.

>> 20-Jul 21:51 ns2-dir: bckm1.2008-07-20_21.19.44 Fatal error: Network

>> error with FD during Backup: ERR=No data available

>> 

>> The last line is where I restart the Bacula client service on bckm1-fd

>> since the script does not complete.  Any idea why this would be

>> hanging on my script?

 

Yes...

 

> If an ssh session won't close after the shell running inside it exits,

> it's usually because some process started from that shell wasn't

> properly demonized and still keeps the terminal open. There are quite

> a few init scripts in the wild which have that problem. Although I

> don't know Alfresco I would guess it's one of them.

 

... I'm thinking along the same lines.

 

IIRC, I suggested to run the init script backgrounded and nohup'ed. If

the run after job script finishes then you could investigate if there

are any children or grandchildren of it still running, and you could

check which files (terminals, in this case) those have left open.

 

You could even check which files your currently running alfresco has open.

 

A well-behaving daemon usually closes its stdin, stdout, and stderr

files or reopens them on the fork to background, like this:

 

httpd2-pr 6045 root    0r   CHR    1,3              4610 /dev/null

httpd2-pr 6045 root    1w   CHR    1,3              4610 /dev/null

httpd2-pr 6045 root    2w   REG  253,3   88157 117442915

/var/log/apache2/error_log

 

 

Arno

 

> HTH

> TS

>

>

> ------------------------------------------------------------------------

>

> -------------------------------------------------------------------------

> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge

> Build the coolest Linux based applications with Moblin SDK & win great prizes

> Grand prize is a trip for two to an Open Source event anywhere in the world

> http://moblin-contest.org/redirect.php?banner_id=100&url="">

>

>

> ------------------------------------------------------------------------

>

> _______________________________________________

> Bacula-users mailing list

> Bacula-users AT lists.sourceforge DOT 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 the Moblin Your Move Developer's challenge

Build the coolest Linux based applications with Moblin SDK & win great prizes

Grand prize is a trip for two to an Open Source event anywhere in the world

http://moblin-contest.org/redirect.php?banner_id=100&url="">

_______________________________________________

Bacula-users mailing list

Bacula-users AT lists.sourceforge DOT net

https://lists.sourceforge.net/lists/listinfo/bacula-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users