Re: disappearing files

2011-07-28 Thread Nikos Vassiliadis

On 7/28/2011 10:15 AM, ad...@prnet.org wrote:

Hi,

I am using FreeBSD 8.2 with an UFS filesystem containing a jail. I do a
tar of the whole jail every night. Suddenly after a few weeks of
operation, tar complains about being unable to stat /usr/lib/libmilter.so.


From inside the jail:


ls /usr/lib | grep ^libmilter.so$ returns libmilter.so
ls /usr/lib/libmilter.so returns ls: libmilter.so: No such file or
directory
ls -l /usr/lib  /dev/null returns ls: libmilter.so: No such file or
directory

Trying to access the file from the main system gives the same result.

A reboot returns everything to normal.

Exactly the same also appeared on another machine some time ago, the only
difference was that it appeared on another file.

Does anyone know what can cause this problem ?


File system corruption would cause such behavior. And/Or perhaps
something is wrong with the underlying disk device.

I would search the logs for messages indicating that the storage
medium is failing. Does dmesg contain anything related?

I would also unmount and fsck the file system.

HTH, Nikos
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: disappearing files

2011-07-28 Thread admin
Hi,

Dmesg returns no error. Also smartctl returns no errors. I will wait for
other suggestion before unmounting the volume in this machine for the case
someone else has another suggestion what to check for, because it might be
that by umounting and remounting, it will take again a few month for the
problem to reappear.

On the other machine that was having the problem, dmesg and smartctl also
returned no errors. I rebooted the machine and started fsck which also
returned no error. On remounting, everything was working again.

Bye,
David Arendt

 On 7/28/2011 10:15 AM, ad...@prnet.org wrote:
 Hi,

 I am using FreeBSD 8.2 with an UFS filesystem containing a jail. I do a
 tar of the whole jail every night. Suddenly after a few weeks of
 operation, tar complains about being unable to stat
 /usr/lib/libmilter.so.

 From inside the jail:

 ls /usr/lib | grep ^libmilter.so$ returns libmilter.so
 ls /usr/lib/libmilter.so returns ls: libmilter.so: No such file or
 directory
 ls -l /usr/lib  /dev/null returns ls: libmilter.so: No such file or
 directory

 Trying to access the file from the main system gives the same result.

 A reboot returns everything to normal.

 Exactly the same also appeared on another machine some time ago, the
 only
 difference was that it appeared on another file.

 Does anyone know what can cause this problem ?

 File system corruption would cause such behavior. And/Or perhaps
 something is wrong with the underlying disk device.

 I would search the logs for messages indicating that the storage
 medium is failing. Does dmesg contain anything related?

 I would also unmount and fsck the file system.

 HTH, Nikos
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 freebsd-questions-unsubscr...@freebsd.org



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: disappearing files

2011-07-28 Thread Robert Bonomi

 Date: Thu, 28 Jul 2011 12:30:36 +0200
 From: ad...@prnet.org
 Subject: Re: disappearing files

 Hi,

 Dmesg returns no error. Also smartctl returns no errors. I will wait for
 other suggestion before unmounting the volume in this machine for the case
 someone else has another suggestion what to check for, because it might be
 that by umounting and remounting, it will take again a few month for the
 problem to reappear.

 On the other machine that was having the problem, dmesg and smartctl also
 returned no errors. I rebooted the machine and started fsck which also
 returned no error. On remounting, everything was working again.


When the problem shows up again, run the following script, as superuser,
from inside the jail environment. It requires one argument -- the fully
qualified path name of the 'disappeared' file.

#!/bin/sh 

if [ $# -lt 1 ] ; then
  echo  Usage: $0  pathname
  echo 'pathname' MUST be spcified
  echo
  exit 1
fi
if [ $# -gt 1 ] ; then
  echo  Usage: $0  pathname
  echo only one 'pathname' allowed (\$*\ is invalid)
  echo
  exit 1
fi

dir_name=`dirname $1` export dir_name
file_name=`basename $1 | sed -e 's/[.]/\\//'` export file_name
file_name=`dirname $file_name`
fs_name=`echo f* | tr ' ' '\n' | head -1`
fs_name='df ${fs_name} | tail -1 | cut -d ' ' -f 1'

sync; sync   # this just  minimizes fsck 'chatter'
echo
echo 'fsck output:'
yes |fsck -n  ${fs_name} # don't fix anything, continue if asked
echo
echo 'ls output:'
ls -l ${dir_name}/${file_name}*
echo
echo 'stat output:'
stat  ${dir_name}/${file_name}*
echo
echo 'stat -L output:'
stat  -L ${dir_name}/${file_name}*
echo
echo 'lsof output:'
lsof | grep  ${file_name}

This will show _all_ the relevant info for the file(s) and filesystem.  Run
it when things misbehave, _and_ when things are working properly.  Differences
should prove very informative.

Do -not- be suprised if 'fsck' reports inconsistencies -- such are to be
expected on an 'active' filesystem.  However, the list of inconsistencies
_can_ be useful if 'something unexpected' shows up there.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Disappearing files, created from /etc/X11/Xclients

2007-03-20 Thread Alex Zbyslaw

Laszlo Nagy wrote:



The strange thing is that, if I login with user 'gandalf' who is in 
'wheel', the files are created and saved into 
/tmp/disklessips/gandalf.txt and /tmp/disklessips/gandalf.history.txt. 
But if I login with any other user (they are in group 'users'), no 
files are created, but the window manager IS started. The startwm.py 
program creates these files BEFORE starting gnome, and it does throw 
an error. So they must have been created, but I do not see them 
anywhere. They simply disappear. Never existed? Any thoughts?

[...]
fout = file('%s/%s.txt'%(ddir,os.getlogin()),'wb+')


If os.getlogin() failed non-fatally and returned, say, and empty string, 
then you'd be creating a file called .txt, if I read correctly.  What 
does ls -lsa /tmp/disklessips show?  Do you in fact have .txt and 
.history.txt files (which a simple ls won't show you).


Failing that, you'll just need to include some debugging.  Open a file 
in /tmp to write stuff to, and print *all* the various variables you use 
to that file.  (Or just print them to stdout if that will show up on the 
console).  Then try as some other user and check that everything really 
does have the value you think it does.


Since python doesn't crash, my belief is that it really has written the 
stuff somewhere.


hth,

--Alex




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Disappearing files, created from /etc/X11/Xclients

2007-03-20 Thread Alex Zbyslaw

Please include freebsd-questions on any replies.

Laszlo Nagy wrote:



If os.getlogin() failed non-fatally and returned, say, and empty 
string, then you'd be creating a file called .txt, if I read 
correctly.  What does ls -lsa /tmp/disklessips show?  Do you in 
fact have .txt and .history.txt files (which a simple ls won't show 
you).


There are no '.txt' and '.history.txt' files. :-(

Failing that, you'll just need to include some debugging.  Open a 
file in /tmp to write stuff to, and print *all* the various variables 
you use to that file.  (Or just print them to stdout if that will 
show up on the console).  Then try as some other user and check that 
everything really does have the value you think it does.


Unfortunately, I cannot debug this way. The error is that no files are 
created by normal users, so I cannot use files for logging. Also there 
is no console because this is the /etcX11/Xclients script, e.g. it is 
executed by gdm after logging in to X window system through xdmpc. 
Well, I might setup an xml rpc server for logging, but hey, if I 
cannot write into a wicked file then I should not start with complex 
protocols and networking.


Humour me.  Try opening a fixed filename in a location which you 
double-check is world-writeable.  E.g. /tmp/FOO and print all your 
relevant variables there.  If it works as gandalf, then delete that 
trace file and try as a non-working user.


If that fails, then try opening the file in the home directory of the 
user who you are testing as.


If that fails then you can try logging them with syslog.

If *that* fails then make your console world-writeable for a little 
while and print directly to that (/dev/console) (assuming there is a 
console which you can sit in front of).


One way or another you need to get debugging info to figure out what is 
not working.


I asked this on the FreeBSD questions list because I thought that 
there is some OS specific stuff that I don't know of. 


There's no FreeBSD specific feature which makes file mysteriously 
vanish, that I'm aware of ;-)


Are you sure that if say the file() fails, that a window manager won't 
start anyway?  You can test that by making the filename something 
clearly non-existent.


--Alex






___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Disappearing files, created from /etc/X11/Xclients

2007-03-20 Thread Laszlo Nagy


Unfortunately, I cannot debug this way. The error is that no files 
are created by normal users, so I cannot use files for logging. Also 
there is no console because this is the /etcX11/Xclients script, e.g. 
it is executed by gdm after logging in to X window system through 
xdmpc. Well, I might setup an xml rpc server for logging, but hey, if 
I cannot write into a wicked file then I should not start with 
complex protocols and networking.


Humour me.  Try opening a fixed filename in a location which you 
double-check is world-writeable.  E.g. /tmp/FOO and print all your 
relevant variables there.  If it works as gandalf, then delete that 
trace file and try as a non-working user.


If that fails, then try opening the file in the home directory of the 
user who you are testing as.
I tried this before I wrote to this list. It does not work. No 'normal' 
users can create these files  from /etc/X11/Xclients. But after gnome 
starts up, they can create these files. If I login with a normal user 
and I try to re-run /etc/X11/Xclients then the files gets created, and 
finally I get an error message telling that gnome is already running.

If that fails then you can try logging them with syslog.

How can I do that from Python? :-) I tried this:

from syslog import *
syslog(|LOG_INFO | LOG_USER, 'test')

No exception raised but I found nothing under /var/log.|


Are you sure that if say the file() fails, that a window manager won't 
start anyway?  You can test that by making the filename something 
clearly non-existent.
To your request, I changed the ddir variable to '/nonexistent', and 
gnome was started! So you found the problem! Thanks! :-)


It was that gdm started /usr/local/etc/gdm/Xsession. That script started 
/etc/X11/Xclients but ONLY for user gandalf. It is because I selected 
'use system default session' in gdm before logging in. It was months 
ago, and I forgot it. Other users were using the default gnome session, 
e.g. they were NOT executing the Xclients script.


Thank you again!

  Laszlo

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]