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

Change boot order issue #244

Closed
Fazik opened this issue Jan 29, 2018 · 17 comments
Assignees

Comments

@Fazik
Copy link

@Fazik Fazik commented Jan 29, 2018

Mandatory info for bug reports:
Hello,
When trying to change b_order for jail I'm getting next:
/jails/jailctl/jsetup-tui: get_construct_b_order: not found

FreeBSD version ( uname -a ):
FreeBSD xxx.xxx 11.1-RELEASE-p6 FreeBSD 11.1-RELEASE-p6 #1 r328517M: Mon Jan 29 14:07:45 EET 2018 root@xxx.xxx:/usr/obj/usr/src/sys/MY amd64

CBSD version ( cbsd version ):
11.1.13

@olevole olevole self-assigned this Jan 30, 2018
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Jan 30, 2018

Strangely enough. You did not forget to execute

cbsd initenv

?

Can you grep for get_construct_b_order ? 11.1.13 does not contain get_construct_b_order. Please post after cbsd initenv:

grep -Rn get_construct_b_order /usr/local/cbsd

and

grep -Rn get_construct_b_order /jails/jailctl/*
@Fazik

This comment has been minimized.

Copy link
Author

@Fazik Fazik commented Jan 30, 2018

Hi @olevole
Nope, I didn't forgot. It was clean setup of os, later cbsd was installed from packages(cbsd-11.1.11)
After finding this issue I've updated from ports to 11.1.13 and performed cbsd initenv. but still there is such issue.

grep didn't find anything.
As I understand it is coming from jailctl/jsetup-tui
;; *) get_construct_${mychoice}

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Jan 30, 2018

Can you try to execute without 'jconfig/jsetup-tui':

cbsd jorder-tui

?

get_construct_${mychoice}

<< this choice should not work for order since is defined explicitly above:

https://github.com/cbsd/cbsd/blob/master/jailctl/jsetup-tui#L211

		"order")
/usr/local/bin/cbsd jorder-tui jname="${jname}"

can you make sure that your copy of jsetup-tui looks similarly ?

@Fazik

This comment has been minimized.

Copy link
Author

@Fazik Fazik commented Jan 30, 2018

cbsd jorder-tui worked fine
local jsetup-tui is the same as in branch
Also changed in /jails/jailctl/jsetup-tui

               *)
                        get_construct_${mychoice}
                        continue
                        ;;

to

               *)
                        echo ${mychoice}
                        echo ${jname}
                        get_construct_${mychoice}
                        continue
                        ;;

and recieved in output for "cbsd jconfig jname=gitlab"

b_order
gitlab
/jails/jailctl/jsetup-tui: get_construct_b_order: not found

So ${mychoice} is b_order and it didn't match "order" in case block

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Jan 30, 2018

Haha! Thank you very much! I understood the problem: I have left legacy code and it only works if your containers are active:

https://github.com/cbsd/cbsd/blob/master/jailctl/jsetup-tui#L170

JARG for jid!=0 ( active jail) has b_order

You can change JARG string in /usr/local/cbsd/jailctl/jsetup-tui on 170 string and change b_order to order and re-run cbsd initenv. Hope this fix issue.

olevole added a commit that referenced this issue Jan 30, 2018
"b_order" now is simple "order". Reported and pointed out by: Andrii Mazan aka Fazik
Issue #244
@Fazik

This comment has been minimized.

Copy link
Author

@Fazik Fazik commented Jan 31, 2018

I've performed this change and /jails/jailctl/jsetup-tui has been update, but still it tries to find get_construct_b_order

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Jan 31, 2018

@Fazik If you make a change in /jails/jailcttl/jsetup-tui then you do not need to perform cbsd initenv, since initenv will overwrite files in workdir from /usr/local/cbsd.

If you have a fixed file and the situation is the same, you can check the behavior for offline jail ?

@Fazik

This comment has been minimized.

Copy link
Author

@Fazik Fazik commented Jan 31, 2018

@olevole
Sorry, I meant that I've changed in /usr/local/cbsd/jailctl/jsetup-tui and performed initenv
All this times I've tried to change on stopped instance.
Just noticed that on stopped instance in cbsd jconfig we have "b_order" (which causes troubles) and "order" (works fine) and on running instance we have only "order" which works fine too.
So seems like issue is just in deprecated b_order in menu for stopped instance

olevole added a commit that referenced this issue Jan 31, 2018
b_order is proper value unlike. Reported and pointed out by: Andrii Mazan aka Fazik
Issue #244
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Jan 31, 2018

It seems I confused myself. Maybe I was planning to do order but at the moment, proper name is b_order according to SQL scheme.

Can you fetch and apply last fixes?

fetch -o /usr/local/cbsd/jailctl/jsetup-tui  https://raw.githubusercontent.com/cbsd/cbsd/master/jailctl/jsetup-tui
chmod +x /usr/local/cbsd/jailctl/jsetup-tui
cbsd initenv

and check again. The name of the menu will be: b_order

@Fazik

This comment has been minimized.

Copy link
Author

@Fazik Fazik commented Feb 1, 2018

b_order and order both present and working in both cases (stopped and running instance) but both this options openning new menu with all jails.
I suspect /usr/local/bin/cbsd jorder-tui jname="${jname}" should change settings for particular jail and not create menu with all jails.

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Feb 1, 2018

Good remark. On the one hand, it is useful to see (before the change) which order the selected container occupies at a given time, compared to other environments (for example, simply set the selector in this jail). On the other hand, this is really an extra iteration.

@Fazik

This comment has been minimized.

Copy link
Author

@Fazik Fazik commented Feb 1, 2018

Yep, maybe it should stay as is.
One more bug I've noticed after upgrade from 11.1.11 default template isn't overridden by /jails/etc/jail-freebsd-default.conf. Moreover other templates isn't picked up from /jails/etc/
Should I create new one issue report for this?

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Feb 1, 2018

It's not necessary to start a new issue, I'll definitely check it out. Еhere were some changes in connection with the update of XEN support.

I changed the parameter that regulates active/disabled state for profiles. Now correct values is:

jail_active=1   //for jail profiles
xen_active=1   //for xen profiles
bhyve_active=1   // for bhyve profiles

e.g: https://github.com/cbsd/cbsd/blob/master/etc/defaults/jail-freebsd-vnet.conf#L9
I forgot to write about this into relnotes.

Can you check behavior by adding jail_active="1" into custom profiles ?

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Feb 1, 2018

upd: testing is not necessary, I found a problem. I'll take some timeout to fix it

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Feb 3, 2018

@Fazik Well, adding jail_active=1 options inside custom profiles returns their functionality in my tests. Can you confirm this in your case?

@Fazik

This comment has been minimized.

Copy link
Author

@Fazik Fazik commented Feb 8, 2018

@olevole
Sorry for delay.
Yes, I can confirm that with jail_active=1 custom profiles are visible and default one replaced by custom default.
Many thanks)

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Feb 9, 2018

Commited with 11.1.14-RELEASE into ports tree.
Let me know (and re-open issue) if the problem is not fixed.
CBSD still in development so it is still full of bugs, im sure ;-) Thank you for the reports.

@olevole olevole closed this Feb 9, 2018
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.