IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 43074


Ignore:
Timestamp:
Sep 3, 2026, 1:57:49 PM (3 weeks ago)
Author:
eugene
Message:

look up WORKDIR and RUNDIR from IPP Config system: not a great solution since it requires .ipprc in the web directory, but better than a hard-wired value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-pstamp-20260421/pstamp/scripts/pstamp_server_status

    r43052 r43074  
    3939# ipp build. But currently it's running out of Bill's build
    4040
    41 # EAM 2017.03.08 : need to point at temporary ITC location:
     41# EAM 2026.09.01 : this should be supplied by the calling program or retrieved from the ipprc
    4242# my $ipphome = "/home/panstarrs/ipp";
    43 my $ipphome = "/data/ippc64.1/ippitc";
     43# my $ipphome = "/export/kukui.2/eugene/simtest.20260829";
     44
     45# EAM 2026.09.02 : get workdir and rundir from IPP config
     46
     47my $ipprc;
     48
     49if (!$workdir) {
     50    $ipprc = PS::IPP::Config->new(); # IPP Configuration
     51    $workdir = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_WORKDIR');
     52}
     53if (!$workdir) {
     54    warn("Failed to find PSTAMP_WORKDIR in the config\n");
     55    exit($PS_EXIT_CONFIG_ERROR);
     56}
     57if (!$rundir) {
     58    if (not defined $ipprc) {
     59        $ipprc = PS::IPP::Config->new(); # IPP Configuration
     60    }
     61    $rundir = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_RUNDIR');
     62}
     63if (!$rundir) {
     64    warn("Failed to find PSTAMP_RUNDIR in the config\n");
     65    exit($PS_EXIT_CONFIG_ERROR);
     66}
     67
     68# my $current_dir = `/bin/pwd`;
     69# print "<b>current dir: $current_dir</b><br>\n";
     70
    4471my $status_cmd = "psstatus";
    4572
    46 $rundir = "$ipphome/pstamp" if !$rundir;
     73$rundir = "pstamp" if !$rundir;
    4774
    4875chdir $rundir or die "failed to cd to $rundir";
    … …  
    124151            print $br . "Pantasks Controller $controller_state.\n";
    125152            # loading active labels
    126             my $runlabels = `echo \"show.labels; quit\" \| pantasks_client -c ~ippitc/pstamp/ptolemy.rc \| tail -n +7`;
     153            # XXX we need to either use explicit ptolemy.rc files (like this) or none (like above), but not both!
     154            # my $runlabels = `echo \"show.labels; quit\" \| pantasks_client -c ~ippitc/pstamp/ptolemy.rc \| tail -n +7`;
     155            # XXX the +6 makes tail skip the first 6 lines: this is fragile and depends on the startup message from pantasks_client
     156            my $runlabels = `echo \"show.labels; quit\" \| pantasks_client \| tail -n +6`;
    127157            print $br . "Current Labels: \n" . $runlabels . "\n";
    128158        } else {
    … …  
    164194    # get the space available in the working directory file system
    165195    ## df can stall with NFS issues, need to code better, but not really used anymore so comment out for now
    166     print "<br>Server Working Directory -- status missing/broken for while and can have NFS issues, removed in pstamp_server_status <br>\n";
     196    # print "<br>Server Working Directory -- status missing/broken for while and can have NFS issues, removed in pstamp_server_status <br>\n";
    167197    #my $df_output = `df -h $workdir`;
    168198    #my @lines = split "\n", $df_output;
Note: See TracChangeset for help on using the changeset viewer.