Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000419bareos-core[All Projects] directorpublic2015-02-01 13:482017-10-02 14:51
Reporterstephand 
Assigned To 
PrioritylowSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version14.2.2 
Target VersionFixed in Version 
Summary0000419: admin job does not run script on client
DescriptionWhen using an admin job (a job with Type = Admin) that defines a RunScript with RunsOnClient = yes is not executed.
Steps To ReproduceDefine an admin job with the following parameters:

Job {
  Name = TestAdminJobOnClient
  JobDefs = DefaultJob
  Type = Admin
  Priority = 40

  RunScript {
    RunsWhen = Before
    RunsOnClient = yes
    Fail Job On Error = yes
    Command = "/usr/local/bin/bareos_test_adminjob.sh"
  }
}

The script /usr/local/bin/bareos_test_adminjob.sh:
#!/bin/bash
echo "$(date) bareos_test_adminjob started" >> /tmp/bareos_test_adminjob.log
echo "id: $(id)"
echo "whoami: $(whoami)"
echo "pwd: $(pwd)"
echo -e "output line 1\noutput line 2\noutput line 3"
echo "exiting with exit 1"
echo "$(date) bareos_test_adminjob exiting with exit 1" >> /tmp/bareos_test_adminjob.log
exit 1

Acutal result when running the job:

[root@bareost01 ~]# bconsole
Connecting to Director bareost01:9101
1000 OK: bareost01-dir Version: 14.2.2 (12 December 2014)
Enter a period to cancel a command.
*run job=TestAdminJobOnClient
Using Catalog "MyCatalog"
Run Admin Job
JobName: TestAdminJobOnClient
FileSet: Full Set
Client: bareost01-fd
Storage: File
When: 2015-02-01 13:13:58
Priority: 40
OK to run? (yes/mod/no): yes
Job queued. JobId=263
*
You have messages.
*mes
01-Feb 13:14 bareost01-dir JobId 263: Start Admin JobId 263, Job=TestAdminJobOnClient.2015-02-01_13.14.00_04
01-Feb 13:14 bareost01-dir JobId 263: BAREOS 14.2.2 (12Dec14): 01-Feb-2015 13:14:02
  JobId: 263
  Job: TestAdminJobOnClient.2015-02-01_13.14.00_04
  Scheduled time: 01-Feb-2015 13:13:58
  Start time: 01-Feb-2015 13:14:02
  End time: 01-Feb-2015 13:14:02
  Termination: Admin OK

Expected result:
The output of the script should be in the job messages and
the nonzero exit code should have lead to termination with error.
Additional InformationAttached bareos-dir debug at level 200

Running bareos-fd with debug level 200 at the same time does not show any output when running the admin job.

Note: works as expected when running the same script within a normal backup job:
FileSet {
  Name = "EmptyDirSet"
  Include {
    Options {
      signature = MD5
    }
    File = "/data/emptydir"
  }
}

Job {
  Name = TestJobWithScriptOnClient
  JobDefs = DefaultJob
  Type = Backup
  FileSet = EmptyDirSet
  Priority = 40

  RunScript {
    RunsWhen = Before
    RunsOnClient = yes
    Fail Job On Error = yes
    Command = "/usr/local/bin/bareos_test_adminjob.sh"
  }
}
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action
Attached Files? file icon bareos-dir_debug_TestAdminJobOnClient.out [^] (13,599 bytes) 2015-02-01 13:48

- Relationships

-  Notes
(0002339)
tigerfoot (developer)
2016-08-25 11:55
edited on: 2016-08-25 11:57

Still true with 15.2 version
But work with Run On Client = no
?


- Issue History
Date Modified Username Field Change
2015-02-01 13:48 stephand New Issue
2015-02-01 13:48 stephand File Added: bareos-dir_debug_TestAdminJobOnClient.out
2015-02-01 14:20 mvwieringen Severity minor => feature
2015-11-06 18:02 maik Status new => acknowledged
2016-08-25 11:55 tigerfoot Note Added: 0002339
2016-08-25 11:56 tigerfoot Note Edited: 0002339 View Revisions
2016-08-25 11:57 tigerfoot Note Edited: 0002339 View Revisions


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker