[opensuse] Where to put script to run on shutdown to remove directories?
Listmates, When my laptop connects to smb shares, I have directories created under /mnt for the different shares that are accessed. The scripts I use to mount the shares will automatically create the mount points for the shares if they don't already exist when the shares are mounted. However, since the share are usually unmounted by the shutdown sequence when I shutdown my laptop, the directories under /mnt never get deleted and have been accumulating over time. Right now I have 34 directories under /mnt that makes navigating with konqueror more tedious than it needs to be. What I would like to do I find somewhere I could put a script that gets called on shutdown that I could have unmount the shares and confirm they are unmounted and then remove the directory that was used for the share mount point. I'd like to find somewhere in the shutdown process to put this script without have to create a 'K' script for each runlevel. Is there such a thing? Some generic shutdown script that is sort of like the opposite of boot.local that I could use during shutdown to call my unmount and rm dir script? Thanks in advance for any help you can give. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 2009-01-20 at 02:53 -0600, David C. Rankin wrote:
Listmates,
When my laptop connects to smb shares, I have directories created under /mnt for the different shares that are accessed. The scripts I use to mount the shares will automatically create the mount points for the shares if they don't already exist when the shares are mounted. However, since the share are usually unmounted by the shutdown sequence when I shutdown my laptop, the directories under /mnt never get deleted and have been accumulating over time.
Right now I have 34 directories under /mnt that makes navigating with konqueror more tedious than it needs to be. What I would like to do I find somewhere I could put a script that gets called on shutdown that I could have unmount the shares and confirm they are unmounted and then remove the directory that was used for the share mount point. I'd like to find somewhere in the shutdown process to put this script without have to create a 'K' script for each runlevel.
Is there such a thing? Some generic shutdown script that is sort of like the opposite of boot.local that I could use during shutdown to call my unmount and rm dir script?
Look in /etc/rc.d. I would out the script there. Use something like powerd (should be there) as a basis. Whatever you put in the 'start' section will happen when you boot. Whatever is in the 'stop' will happen when you shut down. Note that the comments at the start are not really comments. 'man insserv' tells about them. Then, to activate the script, use the insserv command.
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- Roger Oberholtzer
OPQ Systems / Ramböll RST Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden Office: Int +46 8-615 60 20 Mobile: Int +46 70-815 1696 -- "On two occasions I have been asked (by members of Parliament!), 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage 1791-1871) English computer pioneer, philosopher And remember: It is RSofT and there is always something under construction. It is like talking about a large city with all construction finished. Not impossible, but very unlikely. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday, 2009-01-20 at 02:53 -0600, David C. Rankin wrote:
Is there such a thing? Some generic shutdown script that is sort of like the opposite of boot.local that I could use during shutdown to call my unmount and rm dir script?
You could use halt.local, or you could use a service script (have a look at "/etc/init.d/skeleton*"). - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkl1nukACgkQtTMYHG2NR9UNpwCdFBdWo7MT6V5XzdzYbzDOLYQt I1AAnjBeW3X8ydGXwTbUFWFw+aoV+wEh =OVXr -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Listmates,
When my laptop connects to smb shares, I have directories created under /mnt for the different shares that are accessed. The scripts I use to mount the shares will automatically create the mount points for the shares if they don't already exist when the shares are mounted. However, since the share are usually unmounted by the shutdown sequence when I shutdown my laptop, the directories under /mnt never get deleted and have been accumulating over time.
Right now I have 34 directories under /mnt that makes navigating with konqueror more tedious than it needs to be. What I would like to do I find somewhere I could put a script that gets called on shutdown that I could have unmount the shares and confirm they are unmounted and then remove the directory that was used for the share mount point. I'd like to find somewhere in the shutdown process to put this script without have to create a 'K' script for each runlevel.
Is there such a thing? Some generic shutdown script that is sort of like the opposite of boot.local that I could use during shutdown to call my unmount and rm dir script?
Thanks in advance for any help you can give.
Take a look at /etc/init.d/halt.local. -- Use OpenOffice.org <http://www.openoffice.org> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
David C. Rankin wrote:
Listmates,
When my laptop connects to smb shares, I have directories created under /mnt for the different shares that are accessed. The scripts I use to mount the shares will automatically create the mount points for the shares if they don't already exist when the shares are mounted. However, since the share are usually unmounted by the shutdown sequence when I shutdown my laptop, the directories under /mnt never get deleted and have been accumulating over time.
Right now I have 34 directories under /mnt that makes navigating with konqueror more tedious than it needs to be. What I would like to do I find somewhere I could put a script that gets called on shutdown that I could have unmount the shares and confirm they are unmounted and then remove the directory that was used for the share mount point. I'd like to find somewhere in the shutdown process to put this script without have to create a 'K' script for each runlevel.
Is there such a thing? Some generic shutdown script that is sort of like the opposite of boot.local that I could use during shutdown to call my unmount and rm dir script?
Thanks in advance for any help you can give.
Take a look at /etc/init.d/halt.local.
Thanks James, Carlos and Roger, halt.local looks like the easiest route! -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (4)
-
Carlos E. R.
-
David C. Rankin
-
James Knott
-
Roger Oberholtzer