Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I rebooted expecting to find the share mounted and it is not.
I can again run the script manually from the command line, but it does not work during the boot process.
When you run from sh(bash) you path= is more complete.
When your init/inittab launches, path=/bin:/usr/bin:/sbin:/usr/sbin
I bet this is not enough.
I bet there are executables outside the standard basic init path that your script(s) need.
A 2nd place to look is your kernel.
Do you have smbfs/cifs compiled directly in or as a module.
If module, when is module loaded.
Finally, add some script outputs and use "tee" to capture output to a file say in var/log/mnt_gcctfs1.out
echo out the Time/Date, path, runlevel, the $0, $#, $* inputs and anything else that might be helpful. For example, I include in all cron/init scripts:
#!/bin/sh
CMD0="`basename $0`"
LOGX="/var/log/${CMD0}.log"
#
echo "CMD0=$CMD0 $*" | tee -a $LOGX
echo " now=`date +\"%Y-%m-%d_%a %H:%M:%S\"`" | tee -a $LOGX
echo "LOGX=$LOGX" | tee -a $LOGX
echo "PATH=$PATH" | tee -a $LOGX
I installed smbfs after the install via apt so I'm sure it is a module.
I put your code at the top of my script. I ran the script manually from the command line. Once with the start argument and twice with the stop argument.
Here's what I get:
Do you know if the script is bein run OK? Do a simple test like "touch /home/test.touch" or something in there.
My initial though is you are running this before your network is up, which is what the _netdev mount option is for. See http://www.linuxquestions.org/questi...tartup-651969/ (although this thread is working for some reason that stumps me at present)
I wound up putting a call to this script in /etc/cd.local and this seems to work fine.
I now have created a script to test to see if the share is mounted.
Code:
#!/bin/bash
SUCCESS=`mount|grep engineer|cut -d '/' -f3`
FAIL=`mount|grep engineers|cut -d '/' -f3`
echo $SUCCESS
echo #FAIL
if [ -n $SUCCESS ]
then
echo "Engineer Mounted."
else
echo "Engineer NOT Mounted."
fi
if [ -n $FAIL ]
then
echo "Engineers Mounted."
else
echo "Engineers NOT Mounted."
fi
This is just a test script.
If I run mount I get:
Code:
root@gcnpd:~/scripts# mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.22-14-generic/volatile type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
//gcctfs1/engineer on /media/engineer type smbfs (rw)
The last line is the one of interest.
Here are the results of a run of my script:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.