Remove need for /usr/local/bin

The half hourly job to ping all the active PingER hosts is at ~cottrell/bin/pinger_startup.pl. It in turn calls pinger2.pl to make the measurements.

In CentOS  there is no /usr/local/bin so we need to make the following change in pinger_startup, and after testing restore 

#my $PERL_PATH="/usr/local/bin/perl";

my $PERL_PATH="/usr/bin/perl";

Failure to restore $PERL_PATH results in email with:

Can't locate XML/Simple.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /afs/slac/package/pinger/pinger2/share/pinger/pinger2.pl line 450.
BEGIN failed--compilation aborted at /afs/slac/package/pinger/pinger2/share/pinger/pinger2.pl line 450.

An improved solution is:

use Net::Domain qw(hostname hostfqdn hostdomain);  

my $hostname = hostname();#eg $hostname='pinger'

my $hostfqdn = hostfqdn();#eg $hostfqdn='pinger.slac.stanford.edu'

my $PERL_PATH="/usr/local/bin/perl";

if($hostname eq 'pinger-test') {$PERL_PATH="/usr/bin/perl";}

Access to /nfs

INC0346900:

I am unable to access the following /nfs file on pinger-test.pl from either the pinger or cottrell accounts, but am able to access it from the cottrell@pinger.slac.stanford.edu or pinger@pinger.slac.stanford.edu accounts:
[pinger@pinger-test ~]$ ls -l /nfs/slac/g/net/pinger/pinger2/data//ping-2022-01.txt
ls: cannot access /nfs/slac/g/net/pinger/pinger2/data/ping-2022-01.txt: No such file or directory
[cottrell@pinger-test ~]$ ls -l /nfs/slac/g/net/pinger/pinger2/data//ping-2022-01.txt
ls: cannot access /nfs/slac/g/net/pinger/pinger2/data/ping-2022-01.txt: No such file or directory

However I can access it from cottrell@pinger
[cottrell@pinger ~]$ ls -l /nfs/slac/g/net/pinger/pinger2/data/ping-2022-01.txt
-rw-r--r-- 1 pinger sf 66517964 Jan 6 16:37 /nfs/slac/g/net/pinger/pinger2/data//ping-2022-01.txt
or pinger@pinger
[pinger@pinger ~]$ ls -l /nfs/slac/g/net/pinger/pinger2/data/ping-2022-01.txt
-rw-r--r-- 1 pinger sf 66709377 Jan 6 16:47 /nfs/slac/g/net/pinger/pinger2/data/ping-2022-01.txtPinger-test has not been given access to NFS. (This managed by host, not user.)

Looking in more detail /nfs/slac is not accessible from cottrell@pinger-test
[cottrell@pinger-test ~]$ ls -l /nfs/slac
ls: cannot access /nfs/slac: No such file or directory

Pinger-test has not been given access to NFS. (This managed by host, not user.)

trscrontab -e 

INC0346569:

There is still a minor problem with invoking tracrontab -e, the .bashrc does not appear to be invoked at login.

By using this system you expressly consent to the terms and conditions in
https://www.slac.stanford.edu/comp/policy/use.html

CentOS Linux release 7.9.2009 (Core) VMware, Inc. VMware Virtual Platform
=========================================================================
-bash-4.2$ trscrontab -e
-bash: trscrontab: command not found
-bash-4.2$ source .bashrc
[pinger@pinger-test ~]$ trscrontab -e
trscrontab: Old and new crontabs are identical.
trscrontab: Request scheduled.
[pinger@pinger-test ~]$ cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
alias escrow="perl /afs/slac.stanford.edu/package/scsutils/scripts/escrow"
alias trscrontab=/afs/slac.stanford.edu/package/scsutils/src/trs/cron/trscrontab
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions

In that case, can you rename .bashrc to .bash_profile, and re-login ?

That fixed it:
retaylor:~ cottrell$ ssh pinger@pinger-test.slac.stanford.edu
pinger@pinger-test.slac.stanford.edu's password:
Last login: Thu Jan 6 12:54:02 2022 from 23-124-104-105.lightspeed.sntcca.sbcglobal.net
===============================================================================
This is a Federal computer system and is the property of the United States
Government. It is for authorized use only. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy.

By using this system you expressly consent to the terms and conditions in
https://www.slac.stanford.edu/comp/policy/use.html

CentOS Linux release 7.9.2009 (Core) VMware, Inc. VMware Virtual Platform
===============================================================================
[pinger@pinger-test ~]$ trscrontab -e
trscrontab: Old and new crontabs are identical.
trscrontab: Request scheduled.
[pinger@pinger-test ~]$

escrow edit -c netdev cottrell

INC0346741:

I note that escrow does not seem to work on pinger-test or cent7a
[cottrell@pinger-test ~]$ escrow edit -c netdev cottrell
escrow: Command not found.

Put the following in ~cottrell/.cshrc
alias escrow "perl /afs/slac.stanford.edu/package/scsutils/scripts/escrow"
alias trscrontab /afs/slac.stanford.edu/package/scsutils/src/trs/cron/trscrontab
For pinger, put the following in ~pinger/.bash_profile
alias escrow="perl /afs/slac.stanford.edu/package/scsutils/scripts/escrow"
alias trscrontab=/afs/slac.stanford.edu/package/scsutils/src/trs/cron/trscrontab

I now get:

[cottrell@pinger-test ~]$ escrow edit -c netdev cottrell
/afs/slac.stanford.edu/package/console/@sys/slacmsg: error while loading shared libraries: libgssapi_krb5.so.2: cannot open shared object file: No such file or directory
File cottrell was escrowed to the following users:
cottrell@slac.stanford.edu

You need a pass phrase to unlock your RSA secret key.
Key for user ID "Les Cottrell <cottrell@slac.stanford.edu>"

Enter pass phrase:

Good signature from user "Les Cottrell <cottrell@slac.stanford.edu>".
Signature made 2022/01/04 18:27 GMT

WARNING: Because this public key is not certified with a trusted
signature, it is not known with high confidence that this public key
actually belongs to: "Les Cottrell <cottrell@slac.stanford.edu>".
No changes, nothing stored
[cottrell@pinger-test ~]$

I think you can ignore the error from slacmsg. It is just a logging issue.

Since slacmsg is 32bit and depends on a lots of 32bit libraries, I am not sure I should install all of them, especially those 32bit PAM related libraries.


  • No labels