firstlogin script can't be executed because the permission of /root directory is 0700 in the virtual machine created by python-vm-builder
Bug #378639 reported by
Yufei
This bug affects 7 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vm-builder (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
Binary package hint: python-vm-builder
If you create virtual machine by python-vm-builder, it will setup the permission /root to 0700 in the virtual machine.
But the firstlogin and firstboot scripts are copied /root. firstboot script will excute, but firstlogin will fail because the permission problem.
A quick fix is run chmod 0755 in the firstboot script.
I don't know whether iit's by design or not.
Changed in vm-builder (Ubuntu): | |
importance: | Undecided → Low |
Changed in vm-builder (Ubuntu): | |
assignee: | Chuck Short (zulcss) → nobody |
Changed in vm-builder (Ubuntu): | |
status: | New → Triaged |
To post a comment you must log in.
Additionally the firstlogin script probably shouldn't run as root, it should instead run as the login user.
I made some modifications to write the file to /home/$ USER/.firstboot .sh for the user specified with --user (or the default). It's created with permissions 0777 so that it can be removed by the user (since it's a one time script for the first login of the default user). I also changed the firstloginrc template to simply test for the existance of $HOME/.firstboot.sh run it if it exists, and remove the file if it exits successfully.