New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind-dirs docs are wrong #2661

Open
Rudd-O opened this Issue Mar 3, 2017 · 13 comments

Comments

Projects
None yet
6 participants
@Rudd-O

Rudd-O commented Mar 3, 2017

https://www.qubes-os.org/doc/bind-dirs/

at no point is it mentioned that the user is supposed to place the bound dir or file into /rw/bind-dirs/<full path to file to shadow in the original file system>

I wasted 15 minutes with trial and error because I did not know this.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 3, 2017

Member

Technically, you're right. But the idea of bind-dirs is that you configure what file/directory should persist, and then modify it in it's original place (after calling bind-dirs, or restarting a VM).

Member

marmarek commented Mar 3, 2017

Technically, you're right. But the idea of bind-dirs is that you configure what file/directory should persist, and then modify it in it's original place (after calling bind-dirs, or restarting a VM).

@marmarek marmarek added the C: doc label Mar 3, 2017

@Rudd-O

This comment has been minimized.

Show comment
Hide comment
@Rudd-O

Rudd-O Mar 3, 2017

Do please document that, cos it's not mentioned either. All it says is "Done" as the last step. No indication that the user should edit a file or whatevs.

Also, some of us automate things upfront, we aren't in the business of editing files after a reboot, so for us, we need to know where the bound file will be stored.

A section "How does it work?" would also be useful.

Rudd-O commented Mar 3, 2017

Do please document that, cos it's not mentioned either. All it says is "Done" as the last step. No indication that the user should edit a file or whatevs.

Also, some of us automate things upfront, we aren't in the business of editing files after a reboot, so for us, we need to know where the bound file will be stored.

A section "How does it work?" would also be useful.

@andrewdavidwong andrewdavidwong added this to the Documentation/website milestone Mar 3, 2017

@unman

This comment has been minimized.

Show comment
Hide comment
@unman

unman Mar 3, 2017

Member

@Rudd-O I don't understand the issue -

the user is supposed to place the bound dir or file into /rw/bind-dirs/

No they're not - creating the entry and rebooting should do this automatically. If it doesn't then it's a bug and should be reported as such. It's not a documentation issue.

Can you provide more detail on what you are doing? (I wonder if you are trying to persist a file that is in the TemplatebasedVM but doesn't yet exist in the root.img - that's explicitly ruled out in the documentation, although there is a workaround.)
If you dont want to change the file what are you using bind-dirs for? If you simply want to change a file in the template you can already do this with the edited file in /rw/config and an appropriate entry in rc.local

A section "How does it work?" would also be useful

Yes it would.

Member

unman commented Mar 3, 2017

@Rudd-O I don't understand the issue -

the user is supposed to place the bound dir or file into /rw/bind-dirs/

No they're not - creating the entry and rebooting should do this automatically. If it doesn't then it's a bug and should be reported as such. It's not a documentation issue.

Can you provide more detail on what you are doing? (I wonder if you are trying to persist a file that is in the TemplatebasedVM but doesn't yet exist in the root.img - that's explicitly ruled out in the documentation, although there is a workaround.)
If you dont want to change the file what are you using bind-dirs for? If you simply want to change a file in the template you can already do this with the edited file in /rw/config and an appropriate entry in rc.local

A section "How does it work?" would also be useful

Yes it would.

@adrelanos adrelanos referenced this issue in QubesOS/qubes-doc Mar 3, 2017

Merged

clarify bind-dirs usage #296

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Mar 3, 2017

Member

Improved usage instructions a bit:
QubesOS/qubes-doc#296

Member

adrelanos commented Mar 3, 2017

Improved usage instructions a bit:
QubesOS/qubes-doc#296

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Mar 3, 2017

Member
Member

adrelanos commented Mar 3, 2017

@Rudd-O

This comment has been minimized.

Show comment
Hide comment
@Rudd-O

Rudd-O Mar 3, 2017

Rudd-O commented Mar 3, 2017

@Rudd-O

This comment has been minimized.

Show comment
Hide comment
@Rudd-O

Rudd-O Mar 3, 2017

Rudd-O commented Mar 3, 2017

@unman

This comment has been minimized.

Show comment
Hide comment
@unman

unman Mar 3, 2017

Member

@adrelanos

What's the workaround?

Put the files in /rw/bind-dirs...
Edit bind-dirs.sh in template to create the ro file/directory if it doesn't already exist. I wouldn't want to see this in the released code.

@Rudd-O I think I understand your issue.
I'll try something and see if it matches your expectations,(which are a use case that @adrelanos hadn't considered.)

Member

unman commented Mar 3, 2017

@adrelanos

What's the workaround?

Put the files in /rw/bind-dirs...
Edit bind-dirs.sh in template to create the ro file/directory if it doesn't already exist. I wouldn't want to see this in the released code.

@Rudd-O I think I understand your issue.
I'll try something and see if it matches your expectations,(which are a use case that @adrelanos hadn't considered.)

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Mar 3, 2017

Member
Member

adrelanos commented Mar 3, 2017

@Rudd-O

This comment has been minimized.

Show comment
Hide comment
@Rudd-O

Rudd-O Mar 3, 2017

Rudd-O commented Mar 3, 2017

@unman unman referenced this issue in QubesOS/qubes-doc Mar 3, 2017

Merged

Clarify some issues regarding bind-dirs #299

@Rudd-O

This comment has been minimized.

Show comment
Hide comment
@Rudd-O

Rudd-O Mar 4, 2017

Rudd-O commented Mar 4, 2017

@jpouellet

This comment has been minimized.

Show comment
Hide comment
@jpouellet

jpouellet Mar 15, 2017

Contributor

Is all this really needs just a note saying that the dirs which are actually bind-mounted (containing the persistent data) reside in /rw/bind-dirs?

Edit: nevermind, just saw the comments here

Contributor

jpouellet commented Mar 15, 2017

Is all this really needs just a note saying that the dirs which are actually bind-mounted (containing the persistent data) reside in /rw/bind-dirs?

Edit: nevermind, just saw the comments here

@Rudd-O

This comment has been minimized.

Show comment
Hide comment
@Rudd-O

Rudd-O Mar 15, 2017

Rudd-O commented Mar 15, 2017

ypid added a commit to ypid/qubes-core-agent-linux that referenced this issue Mar 16, 2017

bind-dirs: Create ro if bind target exists
Before, the script skipped none existing ro paths even if the path
existed below /rw. This would require someone who wants to use bind-dirs
only in TemplateBasedVM to ensure that the pats exist before the
bind-dirs script gets called.

This patch changes this behaviour so that if path exists below /rw, it
is ensured that an (empty) file/directory is present in ro.

Requires docs update. I can open a PR when this PRs looks good.

Fixes limitation: "Does not work if the file / folder in question does not already exist in the root image. I.e. a file that does not exist in the root image cannot be bind mounted in the TemplateBasedVM."
Example use case: https://github.com/debops/ansible-persistent_paths
Tested on: Qubes OS 3.2; Debian 8 Template and TemplateBasedVM
Related to: QubesOS/qubes-issues#2661

ypid added a commit to ypid/qubes-core-agent-linux that referenced this issue Mar 16, 2017

bind-dirs: Create ro if bind target exists
Before, the script skipped none existing ro paths even if the path
existed below /rw. This would require someone who wants to use bind-dirs
only in TemplateBasedVM to ensure that the paths exist before the
bind-dirs script gets called.

This patch changes this behaviour so that if path exists below /rw, it
is ensured that an (empty) file/directory is present in ro.

Requires: Docs update. I can open a PR when this PRs looks good.
Fixes limitation: "Does not work if the file / folder in question does
  not already exist in the root image. I.e. a file that does not exist in
  the root image cannot be bind mounted in the TemplateBasedVM."
Example use case: https://github.com/debops/ansible-persistent_paths
Tested on: Qubes OS 3.2; Debian 8 Template and TemplateBasedVM
Related to: QubesOS/qubes-issues#2661

ypid added a commit to ypid/qubes-core-agent-linux that referenced this issue Mar 16, 2017

bind-dirs: Create ro if bind target exists
Before, the script skipped none existing ro paths even if the path
existed below /rw. This would require someone who wants to use bind-dirs
only in TemplateBasedVM to ensure that the paths exist before the
bind-dirs script gets called.

This patch changes this behaviour so that if the path exists below /rw, it
is ensured that an (empty) file/directory is present in ro (where the
corresponding path from /rw is then bind mounted over).

Requires: Docs update. I can open a PR when this PRs looks good.
Fixes limitation: "Does not work if the file / folder in question does
  not already exist in the root image. I.e. a file that does not exist in
  the root image cannot be bind mounted in the TemplateBasedVM."
Example use case: https://github.com/debops/ansible-persistent_paths
Tested on: Qubes OS 3.2; Debian 8 TemplateBasedVM (and Template)
Related to: QubesOS/qubes-issues#2661

ypid added a commit to ypid/qubes-core-agent-linux that referenced this issue Mar 16, 2017

bind-dirs: Create ro if bind target exists
Before, the script skipped none existing ro paths even if the path
existed below /rw. This would require someone who wants to use bind-dirs
only in TemplateBasedVM to ensure that the paths exist before the
bind-dirs script gets called.

This patch changes this behavior so that if the path exists below /rw, it
is ensured that an (empty) file/directory is present in ro (where the
corresponding path from /rw is then bind mounted over).

Requires: Docs update. I can open a PR when this PRs looks good.
Fixes limitation: "Does not work if the file / folder in question does
  not already exist in the root image. I.e. a file that does not exist in
  the root image cannot be bind mounted in the TemplateBasedVM."
Example use case: https://github.com/debops/ansible-persistent_paths
Tested on: Qubes OS 3.2; Debian 8 TemplateBasedVM (and Template)
Related to: QubesOS/qubes-issues#2661

@ypid ypid referenced this issue in QubesOS/qubes-core-agent-linux Mar 16, 2017

Merged

bind-dirs: Create ro if bind target exists #42

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Apr 1, 2017

Closed

core-agent-linux v3.2.17 (r3.2) #21

@andrewdavidwong andrewdavidwong changed the title from binddirs docs are wrong to bind-dirs docs are wrong Oct 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment