Commit 539c0fe2 authored by Maarten Litmaath's avatar Maarten Litmaath
Browse files

v1.15:

- The LDAP test now reports the number of cores that jobs will have.
- The crontab permission check has been removed because the command
  returns an error when the user does not have a crontab defined...
parent 216c32f9
#!/bin/bash
# JAliEn VObox Startup Scripts - wrapper
# v1.14 - 2022-02-08
# v1.15 - 2022-05-15
# Authors:
# Kalana Dananjaya <kwijethu@cern.ch>
# Costin Grigoras <Costin.Grigoras@cern.ch>
......@@ -46,8 +46,6 @@ cron_job()
local rm_pat=$1
local entry=$2
crontab -l > /dev/null || return
(
crontab -l | egrep -v -e "$rm_pat"
......
#!/usr/bin/perl
###############################################################################
# Script to report the status of VObox credentials etc.
# v1.12 - 2021-12-20
# v1.15 - 2022-05-15
# Authors:
# Maarten Litmaath <Maarten.Litmaath@cern.ch>
###############################################################################
......@@ -51,14 +51,14 @@ sub timeout_cmd($@)
my ($timeout, @cmd) = @_;
my $output;
pipe READ, WRITE or return (-1, $!);
pipe READ, WRITE or return (-1, $output);
my $pid = fork();
unless (defined $pid) {
close READ;
close WRITE;
return (-1, $!);
return (-1, $output);
}
if ($pid == 0) {
......@@ -125,7 +125,7 @@ sub explain($)
my $sts = ($val >> 8) & 0xFF;
return $sig == 9 ? "timeout" :
$sig ? "killed by signal $sig" : "exit code $sts";
$sig && $val > 0 ? "killed by signal $sig" : "exit code $sts";
}
sub dumpStatus
......@@ -361,18 +361,20 @@ sub test10
my $service = "alien ldap";
chomp(my $vobox = `hostname -f || echo unknown`);
my $srv = 'alice-ldap.cern.ch:8389';
my $cmd = "ldapsearch -LLL -x -h $srv -b o=alice,dc=cern,dc=ch"
. " objectClass=AliEnVOConfig objectClass";
. " '(&(objectClass=AliEnCE)(host=$vobox))' matcharg";
my ($val, $out) = timeout_cmd(30, "$cmd 2>&1");
$out = explain($val) unless defined $out;
if ($out =~ /objectClass: AliEnVOConfig/i) {
dumpStatus($service, 0);
if ($val == 0 && defined $out && $out =~ /./) {
my $cores = ($out =~ /CPUCORES=(\d+)/i) ? $1 : 1;
dumpStatus($service, 0, '', 'Cores' => $cores);
} else {
dumpStatus($service, 1, "The AliEn LDAP server could not be read:"
. filter_out($out));
dumpStatus($service, 1, "VObox '$vobox' not found in LDAP: "
. filter_out($out || explain($val)));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment