 | Distinguished Member with 5,109 posts. | | Join Date: Mar 2006 Location: NJ Experience: Intermediate | | Unmount directories at the end of a user session in ubuntu 8.10 Hello folks,
I have a backup script for my computer running ubuntu 8.10. The script itself is great. It maps the drive and everything but during a shutdown in ubuntu i seem to hit a little bit of a glitch. When shutting down/rebooting the pc seems to hit a hangup point. It shows the ubuntu splash screen, then it shows this on a blank screen:
acpid : exiting
[259.882553] CIFS VFS: SERVER NOT RESPONDING
[259.525205]CIFS VFS: no response for smd 50 mid 11174
To that end i have discovered that this is to do with the mounts not closing properly. So what i want to do is create a script that will automatically unmount the network shares when the pc either a user logs off or the machine shuts down or reboots. The only thing is the umount command requires root, and i want this to happen automatically. But i have no idea how to begin. I know how to configure the umount command however. If someone can explain to me how to create a script that will run when the user ends their session or reboots/shuts down a pc. If someone could tell me where to start it would be appreciated. Like i said the script needs to run as root so the umount will function.
Thanks for all the help in advance.
__________________ -new tech guy
OH MY GOSH THEY KILLED KENNY!
RIP Chopper.....DOB:1/3/2000-DOE: 8/18/08 | | Distinguished Member with 14,988 posts. | | Join Date: Sep 2003 Location: -71.45091, 42.27841 | | Hi new tech guy,
First, run the command:
[as a regular user]
ubuntu@ubuntu:~$ sudo fdisk -l
Then run the command:
ubuntu@ubuntu:~$ mount
The first command will tell you what the device names are of the hard disks in your system, and the second command will tell you which hard drives are mounted.
For automating which drive to unmount, you need to discover the device name of the mounted drive, and issue as root, the following command with the hard drive's device name:
root@ubuntu:~# umount /dev/xxxx
[where xxxx is the device name/partition name of the hard drive which is mounted which you get from the output of the first command for mounted devices from the second command]
-- Tom
__________________ The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein | | Distinguished Member with 5,109 posts. | | Join Date: Mar 2006 Location: NJ Experience: Intermediate | | Thanks lotus, havent gotten a chance lately to look at it lately, will tell you when i do. | | Distinguished Member with 5,109 posts. | | Join Date: Mar 2006 Location: NJ Experience: Intermediate | | As a sidenote, i found a file called .bash-logout. Would that be the file i need to edit with the command? I already know where the directory is. It is a network share in /mount/Username (where username is respectively the name of the user) and /mount/Public (a sharing directory on the network). How would these automate so a user would not have to enter a root password? They are not in the fstab file by the way as they are mounted by a shell script at logon.
__________________ -new tech guy
OH MY GOSH THEY KILLED KENNY!
RIP Chopper.....DOB:1/3/2000-DOE: 8/18/08 | | Distinguished Member with 14,988 posts. | | Join Date: Sep 2003 Location: -71.45091, 42.27841 | | Hi new tech guy,
Have you looked at the contents of .bash_logout?
$ cat .bash_logout (from the user account).
Use the sudo command preface to execute any commands (as root) from the user account (that require root user priviledge), like this:
$ sudo umount /dev/xxxx
-- Tom | | Distinguished Member with 5,109 posts. | | Join Date: Mar 2006 Location: NJ Experience: Intermediate | | This is the output i get from that command: Would i just add the sudo umount command.
~$ cat .bash_logout
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
Would i just create a blank line with:
sudo umount /mount/Username
sudo umount /mount/Public
?
__________________ -new tech guy
OH MY GOSH THEY KILLED KENNY!
RIP Chopper.....DOB:1/3/2000-DOE: 8/18/08 | | Distinguished Member with 5,109 posts. | | Join Date: Mar 2006 Location: NJ Experience: Intermediate | | I tried adding the command to the end, with no avail. Still get the hangup bug when i select to reboot the system. Would another option to possibly somehow remove the shutdown buttons from gnome and replace them with my own shutdown shell script? | | Distinguished Member with 14,988 posts. | | Join Date: Sep 2003 Location: -71.45091, 42.27841 | | What is the full output of the following commands:
$ sudo fdisk -l
and
$ mount
-- Tom |  THIS THREAD HAS EXPIRED.
Are you having the same problem?
We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.
|
Smart Search
| Find your solution! | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |  WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
| You Are Using: |
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 10:25 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd. | |
|