Mailinglist Archive: opensuse (3536 mails)

< Previous Next >
Re: [opensuse] Where to put script to run on shutdown to remove directories?
  • From: Roger Oberholtzer <roger@xxxxxx>
  • Date: Tue, 20 Jan 2009 10:07:32 +0100
  • Message-id: <1232442452.7165.19.camel@xxxxxxxxxxxx>
On Tue, 2009-01-20 at 02:53 -0600, David C. Rankin wrote:

When my laptop connects to smb shares, I have directories created under
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
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
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
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@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >