bartekrutkowski / iocell

iocell - FreeBSD jail manager forked from iocage (discussions: https://groups.google.com/forum/#!forum/iocell)
Other
74 stars 16 forks source link

returned error from pkg(8) is not handled #19

Open dch opened 7 years ago

dch commented 7 years ago

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

When a new jail is created, is is possible to supply pkglist to be installed, however the packages are not installed as the jail is not started prior.

# cat /iocell/templates/template.pkg
ftp/curl
security/ca_root_nss
ports-mgmt/pkg
# iocell create tag=template release=11.0-RELEASE pkglist=/iocell/templates/template.pkg

When -x is used, one sees clearly that iocell create ... pkglist=.... doesn't work if jail is stopped as there is no /bin/sh available to extract the ABI from, for pkg(8) to do its chrooted work. Its not clear if this fails due to changes over time in pkg(8) or in fact it never worked at all.

+ echo '* Installing extra packages..'
* Installing extra packages..
+ cat /iocell/templates/template.pkg
+ __info 'installing: ftp/curl'
+ echo '  INFO: installing: ftp/curl'
  INFO: installing: ftp/curl
+ pkg -c /iocell/jails/78c5509a-085e-11e7-83c8-00bdad1ef709/root install -qy ftp/curl
pkg: open(/bin/sh): No such file or directory
pkg: open(/bin/sh): No such file or directory
pkg: Unable to determine ABI
pkg: Cannot parse configuration file!
+ __info 'installing: security/ca_root_nss'
+ echo '  INFO: installing: security/ca_root_nss'
  INFO: installing: security/ca_root_nss
+ pkg -c /iocell/jails/78c5509a-085e-11e7-83c8-00bdad1ef709/root install -qy security/ca_root_nss
pkg: open(/bin/sh): No such file or directory
pkg: open(/bin/sh): No such file or directory
pkg: Unable to determine ABI
pkg: Cannot parse configuration file!
+ __info 'installing: ports-mgmt/pkg'
+ echo '  INFO: installing: ports-mgmt/pkg'
  INFO: installing: ports-mgmt/pkg
+ pkg -c /iocell/jails/78c5509a-085e-11e7-83c8-00bdad1ef709/root install -qy ports-mgmt/pkg
pkg: open(/bin/sh): No such file or directory
pkg: open(/bin/sh): No such file or directory
pkg: Unable to determine ABI
pkg: Cannot parse configuration file!
+ echo '  Successfully created: 78c5509a-085e-11e7-83c8-00bdad1ef709 (template)'
  Successfully created: 78c5509a-085e-11e7-83c8-00bdad1ef709 (template)
+ [ ! -z '' ]
+ exit
# 

If the jail is first started, then packages are able to be installed as expected, but then this renders the template jail useless. Fix is likely to use same pkg changes as #17.

lrosenman commented 7 years ago

I'm seeing this as well. on another note, is the pkglist file supposed to be category/port or package name? (I.E. mail/exim, or exim-4.88 or exim?)