[Bacula-users] Run ClientBeforeJob script in background instead of waiting for it.

2019-01-04 Thread David Brodbeck
This is driving me nuts because I feel like it should be straightforward
and I must be missing something basic.

I want to launch the caffeinate command on OS X before starting a job.
Caffeinate takes a command as an argument, then goes into the background
and keeps the machine awake until the command exits. I use this after
waking machines up using a WOL script.

When tested from the command line, caffeinate immediately backgrounds
itself. However, when I try to run it as a Bacula ClientBeforeJob script,
bacula-fd waits around forever for caffeiniate to exit.

Here's what I've tried so far:
- Having bacula run a script that then runs caffeinate.
- Having bacula run a script that then runs caffeinate using nohup.
- Having the script redirect stdin, stdout, and stderr of caffeinate to
/dev/null
- Adding an ampersand after the script in the bacula ClientBeforeJob
specification.

What invariably happens is the bash process created by bacula becomes a
zombie and waits for caffeinate to exit. Inspecting the caffeinate process
with lsof shows all of the file handles are redirected to /dev/null as
expected, so I don't think this is a case of stdin or stdout causing
problems. In all cases the only way to get bacula to finish the backup is
to kill the script that caffeinate is running.

I can't figure out why I can't get bacula-fd to move on after the script
goes into the background. When I run the script manually from the command
line it backgrounds immediately.

The oddest thing is this worked fine on clients using bacula-fd version
7.4.x, but fails on a client using 9.2.0.

Here's the script bacula-fd runs, as it currently stands:

--
#!/bin/bash

PATH=/bin:/usr/bin:/usr/local/bin

# Script to prevent system sleep while bacula is working.
# see bacula-idle-watch.sh for details.

nohup caffeinate -s bacula-idle-watch.sh 2>&1 >/dev/null /dev/null ) ; do
sleep 300
done

# Once the script exits, the wake-lock is released.
exit 0
--


-- 
David Brodbeck
System Administrator, Department of Mathematics
University of California, Santa Barbara
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Temporarily place autochanger tape drive in service mode?

2019-01-04 Thread Clark, Patti via Bacula-users
Thank you to everyone that replied.  The disable storage command did what was 
needed.  One issue with using it is the obnoxious noise produced by the 
director in every job that was initially assigned the disabled drive.  Kern, 
this is beyond ridiculous.
.
.
.
2019-01-04 10:27:51 rdback2-sd JobId 198498: Warning: 
 Device "adminChanger" requested by DIR is disabled.
2019-01-04 10:27:51 rdback2-sd JobId 198498: Warning: 
 Device "adminChanger" requested by DIR is disabled.
2019-01-04 10:27:51 rdback2-sd JobId 198498: Warning: 
 Device "adminChanger" requested by DIR is disabled.
.
.
. 
And it goes on for pages and pages until the job is assigned an available drive.

Patti
 

On 1/3/19, 1:30 PM, "Bill Arlofski"  wrote:

On 01/02/2019 02:45 PM, Clark, Patti via Bacula-users wrote:
> Is there a way to put a malfunctioning tape drive in an autochanger into a
> service mode via commands without modifying bacula configuration files?
> 
>  
> 
> */Patti Clark/*

Hi Patti,

There is an enable/disable command to do this:

* disable storage= drive=


A status storage will show this drive disabled by "User command":
8<
Device File: "speedy_drv_0" (/path/to/device/0) is not open.
   Device is disabled. User command.
   Drive 0 is not loaded.
   Available Space= GB
8<


To enable it again:

* enable storage= drive=

I do not believe the disable is permanent.. ie: it will not survive an SD
restart, but it should help in your situation.

Hope this help.


Best regards,

Bill


-- 
Bill Arlofski
http://www.revpol.com/bacula
-- Not responsible for anything below this line --


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



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


Re: [Bacula-users] Bacula 9.2.1: Suddenly labelling tapes fails!

2019-01-04 Thread Bill Damage via Bacula-users
 This was resolved on all servers after a recent linux kernel update.
On Saturday, 29 December 2018, 13:09:40 GMT, Bill Damage via Bacula-users 
 wrote:  
 
  I have a follow up, but first the TLDR question - is a Fedora 29 Baclua 
package update imminent from the current 9.2.1 which may address this?
I have an old server from before the LTO days which has a DLT drive. To try to 
narrow down this issue, as seen on 2 servers with 2 previously perfect LTO-3 
drives, I installed Fed 29 and tried to label a DLT tape, i.e. 3rd server, 
third tape drive. It threw the same error:


connecting to Storage daemon BHST-MONKEY-SDLT-INT1 at monkey:9103 ...
Sending label command for Volume "TEST-101" Slot 0 ...
3000 OK label. VolBytes=64512 VolABytes=0 VolType=0 Volume="TEST-101" 
Device="QUANTUM-SDLT-INT1" (/dev/st0)
Catalog record for Volume "TEST-101", Slot 0 successfully created.
Requesting to mount QUANTUM-SDLT-INT1 ...
3902 Cannot mount Volume on Storage Device ""QUANTUM-SDLT-INT1" (/dev/st0)" 
because:
Read label block failed: requested Volume "" on Tape device "QUANTUM-SDLT-INT1" 
(/dev/st0) is not a Bacula labeled Volume, because: ERR=block_util.c:425 Volume 
data error at 0:0! Wanted ID: "BB02", got "". Buffer discarded.
3905 Device ""QUANTUM-SDLT-INT1" (/dev/st0)" open but no Bacula volume is 
mounted.
If this is not a blank tape, try unmounting and remounting the Volume.
Do not forget to mount the drive!!!

*exit
[root@monkey bacula]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit

On Sunday, 23 December 2018, 19:57:21 GMT, Bill Damage via Bacula-users 
 wrote:  
 
 Sending label command for Volume "TEST-04" Slot 0 ...3000 OK label. 
VolBytes=64512 VolABytes=0 VolType=0 Volume="TEST-04" 
Device="HP-ULTRIUM-LTO3-EXT2" (/dev/st1)Catalog record for Volume "TEST-04", 
Slot 0  successfully created.Requesting to mount HP-ULTRIUM-LTO3-EXT2 ...3902 
Cannot mount Volume on Storage Device ""HP-ULTRIUM-LTO3-EXT2" (/dev/st1)" 
because:Read label block failed: requested Volume "" on Tape device 
"HP-ULTRIUM-LTO3-EXT2" (/dev/st1) is not a Bacula labeled Volume, because: 
ERR=block_util.c:425 Volume data error at 0:0! Wanted ID: "BB02", got "". 
Buffer discarded.3905 Device ""HP-ULTRIUM-LTO3-EXT2" (/dev/st1)" open but no 
Bacula volume is mounted.If this is not a blank tape, try unmounting and 
remounting the Volume.Do not forget to mount the drive!!!You have messages.
-
I have 2 Fedora 29 servers, both have been running bacula succesfully for years 
through many upgrades.I was asked for a new LTO-3 volume on one, and it failed 
as above. I assumed the tape was bad so tried another with the same result. I 
then tried these 2 tapes on the second server, different tape drive completely, 
and it fails the same way.
I tested it with Testing Your Tape Drive With Bacula

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
Testing Your Tape Drive With Bacula

Testing Your Tape Drive With Bacula
 |

 |

 |



and got this:
[root@tiger bacula]#  btape -c bacula-sd.conf /dev/st1Tape block granularity is 
1024 bytes.btape: butil.c:290-0 Using device: "/dev/st1" for writing.btape: 
btape.c:478-0 open device "HP-ULTRIUM-LTO3-EXT2" (/dev/st1): OK*test
=== Write, rewind, and re-read test ===
I'm going to write 1 records and an EOFthen write 1 records and an EOF, 
then rewind,and re-read the data to verify that it is correct.
This is an *essential* feature ...
btape: btape.c:1161-0 Wrote 1 blocks of 64412 bytes.btape: btape.c:612-0 
Wrote 1 EOF to "HP-ULTRIUM-LTO3-EXT2" (/dev/st1)btape: btape.c:1177-0 Wrote 
1 blocks of 64412 bytes.btape: btape.c:612-0 Wrote 1 EOF to 
"HP-ULTRIUM-LTO3-EXT2" (/dev/st1)btape: btape.c:1219-0 Rewind OK.23-Dec 10:41 
btape JobId 0: Fatal error: block_util.c:425 Volume data error at 0:0! Wanted 
ID: "BB02", got "". Buffer discarded.btape: btape.c:1236-0 Read block 1 failed! 
ERR=block_util.c:425 Volume data error at 0:0! Wanted ID: "BB02", got "". 
Buffer discarded.
*
What gives? Same failure with different tapes in different tape drives on 
different servers right at the same time!!??
Thanks

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