On Sunday 13 Sep 2015 14:59, Hongyi Zhao conveyed the following to
comp.unix.shell...
> On Sun, 13 Sep 2015 12:51:22 +0000, Kenny McCormack wrote:
>
>> Is it possible that the file is stored on some kind of non-Unix
>> filesystem (e.g., FAT)? That might have the attribute of not saving
>> the full Unix set of permission bits.
>
> No, the filesystem is ext4.
>
> The strange thing is that sometimes I noticed that the execution
> attribute lost, the chance is rare.
>
> And I cann't figure out how to reproduce this issue.
>
> Maybe it's raised from some bug or incompatibility in my OS -- Debian
> jessie -- which is a more recent release and not experienced enough
> testings.
Debian Jessie is the current Debian stable branch, so that's about as
thoroughly tested as it gets.
My guess is that you may be experiencing hardware problems. Possibly
the degradation of your hard disk. Use the smartmontools package if you
suspect that the disk may be dying. Also check whether the cables are
all still properly seated.
However, it may also be more innocent, e.g. a flipped bit somewhere due
to cosmic radiation or EM fields. A clean shutdown and power-off ─ with
the power cable unplugged from the system for about 10-15 minutes ─
followed by a new cold boot should remedy this, normally.
The only way to thoroughly protect your system from EM fields is to put
it inside a Faraday cage, but the best way to protect you from all
environmentally caused digital corruption would be to invest in a system
with ECC, and specifically ECC registered DRAM.
I would either way recommend booting up from a Live CD and run
"badblocks" on your entire hard disk. Depending on the capacity of your
disk, this may be a very time-consuming process. Also run memtest86 on
your system ─ I'm assuming that it's an x86 architecture ─ and let it
run overnight just to make sure. It may not actually find errors even
if there are any, but if it _does_ find errors, then they will never be
false positives, so then it's time to replace that particular RAM
module.
Also, if you suspect that some process is messing with your permissions,
you can try any of the following...:
1. Run a grep for "chmod" throughout your entire /etc tree.
2. Check whether the filesystem in question is mounted with "noexec".
This would normally not unset the execute permission, but would
rather prevent a file with execute permission being executed.
3. In relation to filesystem damage ─ which may or may not have been
caused by a hardware fault ─ run fsck on the filesystem, preferably
from a rescue CD, so that you can be sure that nothing on the disk
itself is mounted. It is possible ─ depending on your machine's
specific configuration ─ that the filesystem automatically gets
remounted read-only when the system detects that there are
inconsistencies between the virtual filesystem layer and the
physical filesystem, e.g. after an unclean shutdown.
4. Check your system logs. As I understand it, Debian Jessie uses
systemd as a replacement for System V init, which means that your
system logger is probably going to be journald, which stores the
logs in a binary format. You can check the logs using the command
"journalctl" ─ it has a man page, and I don't use systemd on my
system, so I cannot give you the exact syntax.
5. Trace back your own steps. It is possible that you forgot to
set the execute permission on the file, or that you did it while
working under another UID ─ e.g. by using su or sudo ─ in which
case the file might have execute permission, but not for the
account from which you were trying to execute it.
--
= Aragorn =
http://www.linuxcounter.net - registrant #223157