When i export the directory where the data really is, i can specify which hosts can mount it. On the remote server i create a mount point directory and then mount it to the source servers directory (that has the data).
I need to run my script on Server X , i would login there and type in the following command to get to the directory, where my script resides (Server Y)�
# cd /net/Server_Y/opt/EHS/scripts
-bash: cd: /net/Server_Y/opt/EHS/scripts: No such file or directory
As you can see the auto mount isn�t working correctly.
Any help is appreciated!!
Automounter on RedHat is autofs.
How is its status?
service autofs status
1 Like
Hello - It says the Automount is running...
Ensure that /etc/auto.master has
/net -hosts
and /etc/nsswitch.conf has
automount: files
(Something else can follow after the files
)
Restart automounter with
service autofs restart
Still not working?
Can you ping Server_Y
?
Can you list its NFS exports with
showmount -e Server_Y
?
Hello - So ensured
/net -hosts
and /etc/nsswitch.conf has
Code:
automount: files
So this is what i see in the my current system.
[root@ussdp137 etc]# showmount -e ussdp137
Export list for ussdp137:
/opt/EHS/ks uss*
/opt/EHS/etc uss*
/opt/EHS/scripts uss*
[root@ussdp137 etc]#
Thanks
Does
cd /net/ussdp137/
work?
If yes, check the NFS server's /etc/exports.
Your Server_X must be granted.
Further, as root you can try a manual NFS mount:
mount ussdp137:/opt/EHS /mnt
If you get "permission denied by server" then it's clear.
(And if it works, do not forget to umount /mnt
.)
Okey i ran the mount process.
[root@ussedb55 /]# mount ussdp137:/opt/EHS/scripts /tmp/mnt/
mount: can't get address for ussdp137
This is the error iam getting...So guess the first thing was the Auto mounter (autofs) is not working...now the Manual is a dud!
anything i can try, next?
---------- Post updated at 03:04 PM ---------- Previous update was at 02:45 PM ----------
Okey got it...i mounted manually with fully hostname.
mount ussdp137.xxxx.com:/opt/EHS/scripts /tmp/mnt/
So all the servers are okey, but just why this one, where i have to give a fully qualified name? - something is wrong with this server....
So when i mounted manually, i gave fully qualified server name(ex. ussdp137.xxxx.com) instead before without the .com.
Thanks
So on other systems the mount works with short hostnames?
Then compare the DNS resolver file /etc/resolv.conf
And compare the hosts: line in /etc/nsswitch.conf
Could this be the issue?...I dont see the "sudoers: files ldap" in nsswitch.conf?
No, "sudoers" can only have an impact on the "sudo" command.
Not related here.
Hello -
So it worked by adding the hostname in the remote server in the /etc/hosts, and iam able to cd to the directory, where my scripts reside.
Thanks!
I have a question: Below script that i wrote for Autosys install....and i want this to be installed on all the servers, currently 2 servers to test and run.
Now i dont think i will be able to run it from my Home Directory because there is an issue with 5.8 version, any other way i can run this?
#!/bin/bash
_ssh=/usr/bin/ssh
set -x
for host in `echo "ussdv101.ca.boeing.com ussdv102.ca.boeing.com"`
do
hostname -f; ssh -qt $host "cat ~cg979d/.file
done
echo "Installing Autosys 11 and WAG. May take a few minutes..."
# Install Autosys
cd /tmp
gtar xpf /net/ussdp137/opt/EHS/sw/WAAE_LinuxR1136.tar.gz
cd WAAE_TMP
./install
cd /
rm -r /tmp/WAAE_TMP
# Install WAG
cd /
gtar xpf /net/ussdp137/opt/EHS/sw/WAGagtRHEL.tar.gz
cd /opt/wag/autosys/bin
./install_auto_profile
cd /opt/wag/autosys/bin
./install
# Migrate Scripts
cp -p /home/autosys/cp8/bin/standard/* /home/autosys/DX1/bin/standard
cd /home/autosys/DX1/bin/standard
chmod 775 /home/autosys/DX1/bin/standard/*
sed -i 's/cp8/DX1/g' *
sed -i 's/\/opt\/autosys/\/opt\/wag/g' *
exit 0
---------- Post updated at 07:56 PM ---------- Previous update was at 12:33 PM ----------
Is it possible to run this command from my mount point
example:
#!/bin/bash
_servers="/tmp/servers.txt"
_out="/tmp/output.$$"
_ssh=/usr/bin/ssh
set -x
for server in $_servers
do
$_ssh $s ./net/ussdp137/opt/EHS/scripts/auto.bash >>$_out
done
Iam trying to run auto.bash from the Mount point. Will this work?
Thanks in Advance!