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

jexport/jimport #35

Closed
krzysztofantczak opened this issue Dec 15, 2014 · 8 comments
Assignees

Comments

@krzysztofantczak
Copy link

@krzysztofantczak krzysztofantczak commented Dec 15, 2014

Hi,

I was playing around with importing and exporting jails but as far as i'm able to export i'm not able to fully(?) import it.

[0] # cbsd jimport racker newjname=fiu
no conf rc.conf file for jail: fiu

I have few jails running here - including gitlab, but...

[0] # ls /usr/jails/jails-rcconf | wc -l
       0

And my jails are working without rc.conf here but it refuses to run after import - /usr/jails/jails-data/fiu-data exists, but it looks weird, like /bin/ is empty (without mounts i guess).

Any clue what am i doing wrong here?

@olevole olevole self-assigned this Dec 15, 2014
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Dec 15, 2014

Yes, I think it was my fault and I some time ago it corrected. At least, I could not reproduce this now on the current version. I would be very grateful if you would check the version from the github:
0) get git:

pkg install git
  1. remove installed version of CBSD ( it is safe for jail data, however, it is desirable to make a backup copy (or test on a different server) ). Its necessary also to the old version did not return via pkg upgrade.
% pkg remove cbsd
  1. If some files exist after removing in /usr/local/cbsd, remove it by hands:
rm -rf /usr/local/cbsd
  1. Clone 10.1.2 (this is release candidate now ;) from GH:
git clone https://github.com/olevole/cbsd.git /usr/local/cbsd
  1. Restore symlinks for bsdconfig module:
mkdir /usr/local/libexec/bsdconfig
ln -sf /usr/local/cbsd/share/bsdconfig/cbsd /usr/local/libexec/bsdconfig/cbsd
  1. Restore rc.d script via symlink:
ln -sf /usr/jails/rc.d/cbsdrsyncd /usr/local/etc/rc.d/cbsdrsyncd
ln -sf /usr/jails/rc.d/cbsdd /usr/local/etc/rc.d/cbsdd

(where /usr/jails is workdir)

  1. Build and install CBSD code
make -C /usr/local/cbsd
make -C /usr/local/cbsd install
  1. Upgrade CBSD code in your workdir from /usr/local/cbsd:
cbsd initenv

or

env workdir="/usr/jails" /usr/local/cbsd/sudoexec/initenv

where /usr/jails - is workdir

  1. Clean object files in /usr/local/cbsd:
make -C /usr/local/cbsd clean

Besides, it is desirable to re-export jail (do not test the old img, perhaps this error was in image header)

@krzysztofantczak

This comment has been minimized.

Copy link
Author

@krzysztofantczak krzysztofantczak commented Dec 15, 2014

Sure, i'll test it under vagrant box, thanks. I'll get back with results ;-)

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Dec 15, 2014

Cool! If you test it on clean environment, do not forget install dependency first and create user/group ( for example just install and remove cbsd from pkg or ports).

@krzysztofantczak

This comment has been minimized.

Copy link
Author

@krzysztofantczak krzysztofantczak commented Dec 15, 2014

Well, i'm getting some stuff like:

root@racker:/home/vagrant # cbsd jstart r0xer
mkdir: /usr/jails/jails/r0xer/usr/home: Read-only file system
mount: /usr/jails/jails/r0xer/usr/home: No such file or directory
mkdir: /usr/jails/jails/r0xer/usr/compat: Read-only file system
mount: /usr/jails/jails/r0xer/usr/compat: No such file or directory

But in general subject of my issue works perfect, thanks again ;-)

PS. is it me? or jimport/jexport is faster in new version?

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Dec 15, 2014

No, export/jimport in terms of speed, nothing has changed. In terms of speed changed only package browser ( when you choice packages to install in jail from jconstruct-tui )

About read-only file system ( I think I know when i break mounts for /compat ) - i'll fix this soon. Thanks for tests and bug reports - I look forward to more bugs ;-))

@olevole olevole closed this Dec 15, 2014
@krzysztofantczak

This comment has been minimized.

Copy link
Author

@krzysztofantczak krzysztofantczak commented Dec 16, 2014

No problem, just a note, there is one more thing in output during jstart:

mailwrapper: cannot exec /usr/libexec/sendmail/sendmail: No such file or directory
/etc/rc: WARNING: failed to start sendmail_submit
Starting sendmail_msp_queue.
mailwrapper: cannot exec /usr/libexec/sendmail/sendmail: No such file or directory
/etc/rc: WARNING: failed to start sendmail_msp_queue
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Dec 16, 2014

This is very strange. I also could not get a similar situation with your /usr/compat mount. You can describe step by step how to get these situations?

I also interested in result of:

sqlite3 /usr/jails/var/db/local.sqlite .dump
@krzysztofantczak

This comment has been minimized.

Copy link
Author

@krzysztofantczak krzysztofantczak commented Dec 19, 2014

Ok, it actually was fault of system full of trashed data from tests, it seems it works (i'm moving to another issue :D)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.