SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running Slackware64-14.2 host and using Slackware64-14.2 LXC containers on it. I am having an interesting problem which is hard for me to troubleshoot.
Basically, if I want to install software inside container by using slackpkg, the ncurses dialog window usually (not always) does not respond to keyboard. I can only kill it with CTRL+C.
There is absolutely no 3rd party software packages neither on host or containers. I am using en_US.UTF-8 locale everywhere and I cannot seem to spot any real correlation in case when or how it works or not work.
It does not matter if I run command from host:
# lxc-attach -n container slackpkg install samba
Or from containers shell:
# lxc-attach -n container
# slackpkg install samba
If I close my terminal application and open several times, then it starts to work properly for a while. Or so it seems.
Containers are being created most standard way:
MIRROR=http://mirrors.atviras.lt/slackware release=14.2 lxc-create -n containername -t slackware
Just wondering which end to explore. Can it be something wrong with my bash environment on client? Or Server? Or Container?
But my .bashrc is pretty basic:
Code:
export PS1="[\[\033[1;34m\w\033[0m]\n[\h \u]$ "
export HISTSIZE="" # Unlimited history
export HISTFILESIZE="" # Unlimited history
export HISTCONTROL=ignoredups #don't put duplicate lines in the history.
Maybe some missing package on the container? But it looks like I have only one dependency unmet, which is gd.so for memusagestat
Code:
# ./missing-deps /usr/bin/
The following file in /usr/bin/ depend on a lib and will need to be rebuilt:
-------
memusagestat
libgd.so.3 => not found
I also had trouble with slackpkg in a container, not exactly as you describe them though. In my case I could avoid those by using 'lxc-console' to attach to the container. If I use 'lxc-attach' I do not get a proper environment, e.g., $HOME is not set and thus a simple 'cd' leads nowhere instead of switching to my home folder. I also think that '.bashrc' will not get sourced but I am not sure about it. Since I solved it with 'lxc-console' I did not investigate any further. Try it and let me know if the problems persist.
lxc-console approach, does work consistently. But is a bit less convenient than lxc-attach. So there must be something with the way lxc-attach handles profile then.
Just tried to use lxc-attach and source /etc/profile by doing . /etc/profile and same thing with .bash_profile and .bashrc, but neither step helped. Slackpkg dialog is still unresponsive.
If it is a mere convenience issue you can also login with 'ssh', in my case this works, too. You will have, however, to configure 'ssh' to login with public/private key authentication once, if you want to avoid typing a password in the future.
Yes, access via ssh would be slightly more convenient than typing passwords each time indeed. And I do run ssh on some containers already (for file sharing purposes mainly). However, it is still much easier to manage numerous containers by using lxc-attach than by adding containers to already lengthy ssh config.
Either way it is still very helpful to know that slackpkg can be used normally via lxc-console or ssh session. It is now possible to investigate further.
The issue has something to do with the environment settings (env). I tried to get it working with something like:
Code:
lxc-attach --keep-env -n container
This fixes the garbled text but the dialog window launched by slackpkg appears to be unresponsive. I am interested in a solution as well. A web search did not yield anything useful, at least for me. It might be more effective to look at what changes other distributions have made to get lxc-attach working with a dialog/ncurses interface.
Just a heads-up about --keep-env from the manpage:
Code:
--keep-env
Keep the current environment for attached programs. This is the
current default behaviour (as of version 0.9), but is is likely
to change in the future, since this may leak undesirable infor‐
mation into the container. If you rely on the environment being
available for the attached program, please use this option to be
future-proof. In addition to current environment variables, con‐
tainer=lxc will be set.
It's less of an issue now, that I've switched to using slackpkg without dialog interface. It's more convenient to semi-automate this process by the use of scrips
Anyhow, thank you for suggestions. I did try sudo -i method, but it did not had any effect unfortunately.
It's less of an issue now, that I've switched to using slackpkg without dialog interface. It's more convenient to semi-automate this process by the use of scrips
Anyhow, thank you for suggestions. I did try sudo -i method, but it did not had any effect unfortunately.
To spot the difference, lxc-attach to your container and (before doing anything else) run the command 'env'; note the details. Now do the 'sudo -i' thing and run 'env' again. Spot the difference? I'll bet there's enough there now to run slackpkg with the dialog interface - it works for me.
Thanks crts for that trick (I mean technique). Previously I used to source a handmade script to set up a sufficient environment but the 'sudo -i' technique is much better.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.