[UCLA-LUG] Running something at shutdown?

Erik Hovland ehovland@zig.usc.edu
Wed, 3 May 2000 12:56:43 -0700


--AkbCVLjbJ9qUtAXD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

On Wed, May 03, 2000 at 12:11:50PM -0700, Dimi Shahbaz wrote:
> Where can I put a little scripty to handle unmounting of SMB mounts
> before it hangs?

/etc/rc.d/rc[0,1,2].d

Call the script K45smbmount. The K<number> part tells init that it is
a kill script to be run at shutdown. My rule of thumb is to use
/etc/rc.d/rc1.d, but YMMV.

> I know shutting down is runlevel 6 (right?)

Actually init level 6 is reboot, close though. 0 is the base run
level, 1 and 2 are always passed through  on the way up and on the way
down and the default multi-user run level is 3. 4 and 5 are left up to
the implementator and 5 is typically the X login screen run level for
linux. There is also a s or single level for single user. There might
be some more, anyone got the red book or essential SA handy?

> Can the script be something other than a shell script (ie, perl)?

Yes, but no one does this, I would imagine there is a reason but I don't
know it. Besides your script should be the most basic of scripts and
bourne/bash should be sufficient.

E

--=20
Erik Hovland
USC Linux User Group President
http://sclug.usc.edu/~ehovland/
GnuPG public key: http://sclug.usc.edu/~ehovland/ehovland.gpg

"Your bastard child of a network has grown up, gone to counseling
 and doesn't want to talk to you anymore." - shupe


--AkbCVLjbJ9qUtAXD
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE5EIR64U3i4m+7U54RAXBeAJ9wAoOvProYgpvydhcVki/GQ+RQ+wCgjUfH
qMeghohyTvkW1IuEA+At9aw=
=+lwG
-----END PGP SIGNATURE-----

--AkbCVLjbJ9qUtAXD--