Index: /branches/eam_branches/ipp-pstamp-20260421/pstamp/scripts/pstamp_server_status
===================================================================
--- /branches/eam_branches/ipp-pstamp-20260421/pstamp/scripts/pstamp_server_status	(revision 43073)
+++ /branches/eam_branches/ipp-pstamp-20260421/pstamp/scripts/pstamp_server_status	(revision 43074)
@@ -39,10 +39,37 @@
 # ipp build. But currently it's running out of Bill's build
 
-# EAM 2017.03.08 : need to point at temporary ITC location:
+# EAM 2026.09.01 : this should be supplied by the calling program or retrieved from the ipprc
 # my $ipphome = "/home/panstarrs/ipp";
-my $ipphome = "/data/ippc64.1/ippitc";
+# my $ipphome = "/export/kukui.2/eugene/simtest.20260829";
+
+# EAM 2026.09.02 : get workdir and rundir from IPP config
+
+my $ipprc;
+
+if (!$workdir) {
+    $ipprc = PS::IPP::Config->new(); # IPP Configuration
+    $workdir = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_WORKDIR');
+}
+if (!$workdir) {
+    warn("Failed to find PSTAMP_WORKDIR in the config\n");
+    exit($PS_EXIT_CONFIG_ERROR);
+}
+if (!$rundir) {
+    if (not defined $ipprc) {
+	$ipprc = PS::IPP::Config->new(); # IPP Configuration
+    }
+    $rundir = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_RUNDIR');
+}
+if (!$rundir) {
+    warn("Failed to find PSTAMP_RUNDIR in the config\n");
+    exit($PS_EXIT_CONFIG_ERROR);
+}
+
+# my $current_dir = `/bin/pwd`;
+# print "<b>current dir: $current_dir</b><br>\n";
+
 my $status_cmd = "psstatus";
 
-$rundir = "$ipphome/pstamp" if !$rundir;
+$rundir = "pstamp" if !$rundir;
 
 chdir $rundir or die "failed to cd to $rundir";
@@ -124,5 +151,8 @@
             print $br . "Pantasks Controller $controller_state.\n";
             # loading active labels
-            my $runlabels = `echo \"show.labels; quit\" \| pantasks_client -c ~ippitc/pstamp/ptolemy.rc \| tail -n +7`;
+	    # XXX we need to either use explicit ptolemy.rc files (like this) or none (like above), but not both!
+	    # my $runlabels = `echo \"show.labels; quit\" \| pantasks_client -c ~ippitc/pstamp/ptolemy.rc \| tail -n +7`;
+	    # XXX the +6 makes tail skip the first 6 lines: this is fragile and depends on the startup message from pantasks_client
+            my $runlabels = `echo \"show.labels; quit\" \| pantasks_client \| tail -n +6`;
             print $br . "Current Labels: \n" . $runlabels . "\n";
         } else {
@@ -164,5 +194,5 @@
     # get the space available in the working directory file system
     ## df can stall with NFS issues, need to code better, but not really used anymore so comment out for now
-    print "<br>Server Working Directory -- status missing/broken for while and can have NFS issues, removed in pstamp_server_status <br>\n";
+    # print "<br>Server Working Directory -- status missing/broken for while and can have NFS issues, removed in pstamp_server_status <br>\n";
     #my $df_output = `df -h $workdir`;
     #my @lines = split "\n", $df_output;
