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

iocage rename command not work well #25

Open
1 task
amutu opened this issue Sep 8, 2024 · 6 comments
Open
1 task

iocage rename command not work well #25

amutu opened this issue Sep 8, 2024 · 6 comments

Comments

@amutu
Copy link

amutu commented Sep 8, 2024

Make sure to follow and check these boxes before submitting an issue! Thank you.

  • [ x] Supply iocage --version
  • [ x] Supply the commands used, along with any steps to recreate it.
  • [ x] Provide the output from the command you issued.
  • [ x] Supply what you expected the result or output to be
  • Checked that the problem has not already been fixed on master if using
    a stable release.

iocage -v
Version 1.2

iocage rename tmp_3 tmp3
Jail: tmp_3 renamed to tmp3

iocage console tmp3
root@tmp-3:~ # hostname
tmp-3-----here and /etc/rc.conf should change to tmp3?

cat /zroot/iocage/jails/tmp3/config.json
{
"basejail": 1,
"cloned_release": "13.3-RELEASE",
"host_hostname": "tmp-3",------here,should be tmp3?
"host_hostuuid": "tmp3",
"jail_zfs_dataset": "iocage/jails/tmp3/data",
"last_started": "2024-09-08 05:58:27",
"release": "13.3-RELEASE-p4"
}

should iocage change the config.json and the hostname of jail?

@dgeo
Copy link
Contributor

dgeo commented Sep 10, 2024

Hi,
Jail name is not jail's hostname, you can have jail1 with hostname machine.example.org, change hostname without renaming the jail (even without access to host, this may be another discussion)

That said, I have to check what is done when changing hostname with iocage set, it may lack /etc/rc.conf part...

@Defenso-QTH
Copy link
Contributor

That would not make sense in the cases of an empty or a Linux jail though.

@amutu
Copy link
Author

amutu commented Sep 11, 2024

Should rename be consistent with create new jail? My use case is create jail with -B -c 5 -n tmp to create 5 base jails named tmp_{1..5} for spare as create jail take minutes to complete. When I really use a jail ,I will rename it to some meaningfull name such as nginx. But it is annoy when I should edit the config.json and rc.conf and restart jail.

@dgeo
Copy link
Contributor

dgeo commented Sep 11, 2024

Historically, jail's 'name' were UUID's (hence the host_hostuuid field), and still are if you don't name them explicitely.
Jail's hostname is initialized from that, but not enforced by default (allow_set_hostname defaults to 1).

Link beetween hostname and jail name(uuid) is not bijective, hostname only defaults to uuid if not explicitely given: I think we can't change hostname if not explicitely asked for (with iocage set host_hostname=…)

@Defenso-QTH
Copy link
Contributor

Maybe there could just be a command line option on rename to set the hostname at the same time.

@amutu
Copy link
Author

amutu commented Oct 3, 2024

Yes, or document this behavior of the rename subcmd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants