Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/mtab permissions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Princess Nell
Guru
Guru


Joined: 15 Apr 2005
Posts: 525

PostPosted: Mon Mar 11, 2013 10:24 pm    Post subject: /etc/mtab permissions Reply with quote

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
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 3898
Location: USA

PostPosted: Mon Mar 11, 2013 11:10 pm    Post subject: Reply with quote

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@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Mar 11, 2013 11:27 pm    Post subject: Reply with quote

The setup these days is:
Code:
ln -sfn /proc/self/mounts /etc/mtab
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2244

PostPosted: Tue Mar 12, 2013 11:24 am    Post subject: Reply with quote

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
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 331
Location: NRW, Germany

PostPosted: Tue Mar 12, 2013 1:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2244

PostPosted: Tue Mar 12, 2013 2:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Tue Mar 12, 2013 2:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Princess Nell
Guru
Guru


Joined: 15 Apr 2005
Posts: 525

PostPosted: Thu Mar 14, 2013 8:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum