mount option can`t set permissions

Bug #893786 reported by Björn Dieding
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Wishlist
Unassigned
cloud-init (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

mounts:
 - [ ephemeral0, /mnt/ephemeral, auto, "defaults" ]
 - [ swap, none, swap, sw, "0", "0" ]

will create this error

[ec2-user@ip-10-234-85-230 ~]$ mkdir -p /mnt/ephemeral/var.live
mkdir: cannot create directory `/mnt/ephemeral/var.live': Permission denied

it looks like a chmod is not implemented

Tags: feature
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for taking the time to report this bug.

I am marking this 'low' priority, per the definition "moderate impact on a non-core application".

Changed in cloud-init (Ubuntu):
importance: Undecided → Low
Revision history for this message
Scott Moser (smoser) wrote :

What sort of syntax would you suggest for cloud-config to set permissions on a mount?
I'm expecting that in your example you just want to have "ubuntu:ubuntu" as the ownership so that the default user could use it.

Changed in cloud-init:
importance: Undecided → Wishlist
status: New → Triaged
Changed in cloud-init (Ubuntu):
status: New → Triaged
Revision history for this message
Björn Dieding (bjoern-a) wrote :

Yes something like this.

 - [ ephemeral0, /mnt/ephemeral, auto, "defaults", "ubuntu:ubuntu", 0755 ]

Revision history for this message
Scott Moser (smoser) wrote : Re: [Bug 893786] Re: mount option can`t set permissions

On Tue, 20 Dec 2011, Björn Dieding wrote:

> Yes something like this.
>
> - [ ephemeral0, /mnt/ephemeral, auto, "defaults", "ubuntu:ubuntu",
> 0755 ]

Hm... i suppose we could add a field there, but it wouldn't be ideal.
I like the fact that the fields represent exactly what is in /etc/fstab.

But any other solution would require mapping the entry to directory.

Revision history for this message
Björn Dieding (bjoern-a) wrote :

I do not know... it is up to you...

Revision history for this message
Sergii Golovatiuk (sgolovatiuk) wrote :

This issue is more serious than you think. For instance, I want to create /tmp as ephemeral. Normally, I assign 1777 permissions to /tmp to allow users to create and delete own files/directories from /tmp. That's very common for very large set of programs. If I set up tmp in cloud-init definition as

 - [ ephemeral0, /tmp, auto, 'defaults,nobootwait,noatime', '0', '2' ]

it means that permission will be 0755 every time after reboot. It makes cloud-init unusable and requires extra hacks such as creating upstart script to fix the permission on /tmp during boot process as stated at http://serverfault.com/questions/427626/how-to-mount-tmp-in-mnt-on-ec2

As a solution you should either implement as

mounts:
 ephemeral0:
  - [/tmp, auto, 'defaults,nobootwait,noatime', '0', '2' ]
  - [/tmp, "root:root, 1777]

or

[ ephemeral0, /tmp, 'defaults', '0', '2', 'ubuntu:ubuntu', '0755']

otherwise this bug makes cloud-init not very usable for mount management

Revision history for this message
traylenator (traylenator) wrote :

This is particularly in the way with CentOS 7 it seems where when the system reboots the boot process stops early as /tmp is not writable.

Revision history for this message
Graham Leggett (minfrin-y) wrote :

We just ran into this issue trying to get cloud-init to create a dedicated partition for /var/tmp. It creates the mount, but with the wrong permissions, and thus breaks the machine.

We've had to hack our config to work around the problem, which is really ugly.

Johnson Shi (johnsonshi)
Changed in cloud-init:
assignee: nobody → Johnson Shi (johnsonshi)
Changed in cloud-init (Ubuntu):
assignee: nobody → Johnson Shi (johnsonshi)
Johnson Shi (johnsonshi)
Changed in cloud-init:
status: Triaged → In Progress
Changed in cloud-init (Ubuntu):
status: Triaged → In Progress
Johnson Shi (johnsonshi)
Changed in cloud-init:
assignee: Johnson Shi (johnsonshi) → nobody
Changed in cloud-init (Ubuntu):
assignee: Johnson Shi (johnsonshi) → nobody
Changed in cloud-init:
status: In Progress → Confirmed
Changed in cloud-init (Ubuntu):
status: In Progress → Confirmed
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.