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 #!/bin/bash
# JAliEn VObox Startup Scripts - wrapper # JAliEn VObox Startup Scripts - wrapper
# v1.14 - 2022-02-08 # v1.15 - 2022-05-15
# Authors: # Authors:
# Kalana Dananjaya <kwijethu@cern.ch> # Kalana Dananjaya <kwijethu@cern.ch>
# Costin Grigoras <Costin.Grigoras@cern.ch> # Costin Grigoras <Costin.Grigoras@cern.ch>
...@@ -46,8 +46,6 @@ cron_job() ...@@ -46,8 +46,6 @@ cron_job()
local rm_pat=$1 local rm_pat=$1
local entry=$2 local entry=$2
crontab -l > /dev/null || return
( (
crontab -l | egrep -v -e "$rm_pat" crontab -l | egrep -v -e "$rm_pat"
......
#!/usr/bin/perl #!/usr/bin/perl
############################################################################### ###############################################################################
# Script to report the status of VObox credentials etc. # Script to report the status of VObox credentials etc.
# v1.12 - 2021-12-20 # v1.15 - 2022-05-15
# Authors: # Authors:
# Maarten Litmaath <Maarten.Litmaath@cern.ch> # Maarten Litmaath <Maarten.Litmaath@cern.ch>
############################################################################### ###############################################################################
...@@ -51,14 +51,14 @@ sub timeout_cmd($@) ...@@ -51,14 +51,14 @@ sub timeout_cmd($@)
my ($timeout, @cmd) = @_; my ($timeout, @cmd) = @_;
my $output; my $output;
pipe READ, WRITE or return (-1, $!); pipe READ, WRITE or return (-1, $output);
my $pid = fork(); my $pid = fork();
unless (defined $pid) { unless (defined $pid) {
close READ; close READ;
close WRITE; close WRITE;
return (-1, $!); return (-1, $output);
} }
if ($pid == 0) { if ($pid == 0) {
...@@ -125,7 +125,7 @@ sub explain($) ...@@ -125,7 +125,7 @@ sub explain($)
my $sts = ($val >> 8) & 0xFF; my $sts = ($val >> 8) & 0xFF;
return $sig == 9 ? "timeout" : return $sig == 9 ? "timeout" :
$sig ? "killed by signal $sig" : "exit code $sts"; $sig && $val > 0 ? "killed by signal $sig" : "exit code $sts";
} }
sub dumpStatus sub dumpStatus
...@@ -361,18 +361,20 @@ sub test10 ...@@ -361,18 +361,20 @@ sub test10
my $service = "alien ldap"; my $service = "alien ldap";
chomp(my $vobox = `hostname -f || echo unknown`);
my $srv = 'alice-ldap.cern.ch:8389'; my $srv = 'alice-ldap.cern.ch:8389';
my $cmd = "ldapsearch -LLL -x -h $srv -b o=alice,dc=cern,dc=ch" 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"); my ($val, $out) = timeout_cmd(30, "$cmd 2>&1");
$out = explain($val) unless defined $out;
if ($out =~ /objectClass: AliEnVOConfig/i) { if ($val == 0 && defined $out && $out =~ /./) {
dumpStatus($service, 0); my $cores = ($out =~ /CPUCORES=(\d+)/i) ? $1 : 1;
dumpStatus($service, 0, '', 'Cores' => $cores);
} else { } else {
dumpStatus($service, 1, "The AliEn LDAP server could not be read:" dumpStatus($service, 1, "VObox '$vobox' not found in LDAP: "
. filter_out($out)); . filter_out($out || explain($val)));
} }
} }
......
Supports Markdown
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