Skip to content
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

[BUG] "bastille rename" does not update fstab content for Linux container #487

Closed
tofazzz opened this issue Jan 16, 2022 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@tofazzz
Copy link
Contributor

tofazzz commented Jan 16, 2022

  • Bug: When renaming a Linux jail with "bastille rename "target" "new name" the command misses to update the paths located in the fstab file for the jail. If I manually update the paths in the file the jail starts fine.

  • Bastille and FreeBSD version:
    0.9.20211225
    13.0-RELEASE-p6

  • Bastille installed via pkg

  • Steps:

  1. Create Linux jail and make sure it runs fine
  2. Stop the jail
  3. Rename the jail with a new name
  4. Start the jail and the following error is shown:
    "mount: /usr/local/bastille/jails/"old jail name": No such file or directory
    jail: "new jail name": /sbin/mount -t devfs -o rw devfs /usr/local/bastille/jails/"old jail name"/root/dev: failed
  • Fix: The command should update the fstab file as well with the new jail name in all mount points
@tofazzz tofazzz added the bug Something isn't working label Jan 16, 2022
@JRGTH
Copy link
Collaborator

JRGTH commented Jan 16, 2022

Hello thanks for report.

This should fix the issue: #488

@tofazzz
Copy link
Contributor Author

tofazzz commented Jan 16, 2022

Thank you very much! :)

@thearchivalone
Copy link

thearchivalone commented Jan 19, 2022

I can confirm. It's not just a Linux jail issue but for normal ones too. I found that manually editing the fstab to reflect the new directory name can sometimes cause the jail to to start up and then never stop without a full server restart too. That probably should be a separate bug, too.

EDIT: My bug was related to this and not Bastille-centric. Carry on

@JRGTH
Copy link
Collaborator

JRGTH commented Jan 20, 2022

I can confirm. It's not just a Linux jail issue but for normal ones too. I found that manually editing the fstab to reflect the new directory name can sometimes cause the jail to to start up and then never stop without a full server restart too. That probably should be a separate bug, too.

EDIT: My bug was related to this and not Bastille-centric. Carry on

Hi, yes you are correct, manually editing not only fstab but also jail.conf while container running is never advisable as anything who changes a path for example may cause the jail start/stop issues as expected.

Also the rename command will take care of the bastille related entries and the user need to update for customs, this is why the bastille rename requires the jail to be stopped on the first place.

Regards

@zilti
Copy link
Contributor

zilti commented Aug 26, 2022

Since the fix for this got merged, it'd be good to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants