View previous topic :: View next topic |
Author |
Message |
Princess Nell l33t
Joined: 15 Apr 2005 Posts: 916
|
Posted: Mon Mar 11, 2013 10:24 pm Post subject: /etc/mtab permissions |
|
|
Not even sure which forum is appropriate for this one
As of recently, I can't really pin it down to any specific update, /etc/mtab is read-only by root upon return from hibernation. Has anyone seen this before? It doesn't matter whether I hibernate through Gnome or hibernate-script (I never got suspend to work).
Who or what maintains this file, the kernel? I've been running 3.7.10 for a bit over a week. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Mon Mar 11, 2013 11:10 pm Post subject: |
|
|
Since /etc/mtab is on the filesystem and not somewhere like /proc or /sys, mtab is handled by userspace apps only like mount and umount.
I actually am not sure what's the problem with it read-only, only root or suid root can/should edit this file anyway, and sometimes it's even linked to /proc/mounts which is the kernel's idea of what filesystems are mounted (and thus more accurate). Exactly what's broken here?
I need to check hibernation on my eeepc, have not tried hibernation in a while... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Mon Mar 11, 2013 11:27 pm Post subject: |
|
|
The setup these days is:
Code: | ln -sfn /proc/self/mounts /etc/mtab |
|
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Mar 12, 2013 11:24 am Post subject: |
|
|
PaulBredbury ...
that maybe the case for ubuntu and/or systemd, but the openrc method is to update the file if /etc/init.d/mtab is run.
best ... khay |
|
Back to top |
|
|
Dr.Willy Guru
Joined: 15 Jul 2007 Posts: 547 Location: NRW, Germany
|
Posted: Tue Mar 12, 2013 1:43 pm Post subject: |
|
|
khayyam wrote: | PaulBredbury ...
that maybe the case for ubuntu and/or systemd, but the openrc method is to update the file if /etc/init.d/mtab is run.
best ... khay |
…unless if /etc/mtab is a symlink, which it checks beforehand. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Mar 12, 2013 2:13 pm Post subject: |
|
|
Dr.Willy wrote: | khayyam wrote: | that maybe the case for ubuntu and/or systemd, but the openrc method is to update the file if /etc/init.d/mtab is run. |
…unless if /etc/mtab is a symlink, which it checks beforehand. |
Dr.Willy ... yes, I'm aware of that, but nothing but human intervention will create the sym-link, so its not a change involved as part of a "specific update" (see Princess Nell's original post).
best ... khay |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Tue Mar 12, 2013 2:35 pm Post subject: |
|
|
Here's some interesting background reading from Debian.
Quote: | Who or what maintains this file, the kernel? |
The mount and umount commands - which is nuts (especially if mount wants to mount something when the root partition is read-only, during e.g. bootup). So being a symlink is better, to use the kernel's own info.
(Works fine for me in good ol' sysvinit.) |
|
Back to top |
|
|
Princess Nell l33t
Joined: 15 Apr 2005 Posts: 916
|
Posted: Thu Mar 14, 2013 8:40 pm Post subject: |
|
|
What's broken here? Non-root users can't use df.
Code: |
user@host ~ $ df
df: cannot read table of mounted file systems: Permission denied
user@host ~ $
|
The symlink method seems to work fine.
The problem here is that I cannot demonstrate this behaviour reliably. Yesterday, permissions were fine after waking up from hibernation, today they were not. I'd put this down just as one the many little reliability problems I'm experiencing with hibernation in general, little bits and pieces not working after waking up. |
|
Back to top |
|
|
|