[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Synching volumes on logout



On Wed, 24 Dec 2003 09:28:51 +0100, David Baron wrote:

> This would be a good idea. Sometimes, the shutdown fails leaving a damaged 
> volume. I just did a manual fsck as well and good but it is a bit scarey :-)
> 
> How might I assure such a logout synch? Is there a utility to do this? 
> Unmount;mount ?
> 
> General question: How does one set up a login and logout script -- such as to 
> start certain application (OK, KDE will keep your session, but...) but such a 
> login script is obviously being run and doing a knoppix desktop setup of some 
> kind. There must also be some way of a logout script as well.

I have not had a shutdown fail... perhaps someone could help you with this
if you would post an explanation.

You don't say what filesystem type(s) you are using;  if you switch to a
journalling filesystem, then your filesystems will always be clean (at the
expense of reduced performance on writes).  If you are using ext2, then it
is a simple matter to convert to ext3.  When I first considered
converting, I tested ext3 fairly brutally by cutting power in the middle
of writes.  I was unable to break it, always came up clean.  This is a
personal observation, not any guarantee.

You do not say which shell you are using.  If you are using bash, then
there are three files relevant to your question:

~/.bash_profile executed by bash for a login shell.
~/.bashrc - executed by bash for non-login shells.
~/.bash_logout - executed when login shell exits.

As s. keeling replied, "man bash" for further info.  There are also a lot
of shell scripting tutorials out there on the web; also, there is a Linux
"Bash Programming - Introduction" HOWTO.

A Happy Christmas to you.

-- 
....................paul

And the Word was made flesh, and dwelt among us, (and we beheld his
glory, the glory as of the only begotten of the Father,) full of grace
and truth.
- John 1:14, KJV



Reply to: