LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-29-2020, 05:00 PM   #16
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,424

Rep: Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597

Quote:
Originally Posted by montagdude View Post
That worked. I didn't need to make any changes to pam_securetty in order to get it installed and apparently working. So to summarize, the following 4 packages need to be added to the list:
  • cracklib
  • libpwquality
  • libtirpc
  • pam
also some others, like libpsl and pcre2, as the newer wget links to them: if you don't add them you will have issues adding stuff later to the container OS via slackpkg.

Last edited by ponce; 06-29-2020 at 05:01 PM.
 
1 members found this post helpful.
Old 06-29-2020, 05:03 PM   #17
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 1,910

Original Poster
Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Quote:
Originally Posted by ponce View Post
also some others, like libpsl and pcre2, as the newer wget links to them: if you don't add them you will have issues adding stuff later to the container OS via slackpkg.
I haven't added those ones, and slackpkg is downloading new packages just fine.
 
Old 06-29-2020, 05:08 PM   #18
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,424

Rep: Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597
Quote:
Originally Posted by montagdude View Post
I haven't added those ones, and slackpkg is downloading new packages just fine.
yes, that happens maybe because I included them in the template some time ago but the libraries have been bundled in aaa_elflibs too since then.
 
Old 06-29-2020, 05:27 PM   #19
petejc
Member
 
Registered: Apr 2019
Distribution: Slackware
Posts: 111

Rep: Reputation: Disabled
Quote:
Originally Posted by ponce View Post
I just tested it and I spotted an issue with pam_securetty (as we seem to login from pts/0 using lxc-console): you can check if this is solves your issue editing /etc/securetty in the container (allowing login from pts)
Code:
sed -i "s|^#pts|pts|" $ROOT/etc/securetty
you should also have related errors in /var/log/secure if this is the case...
I ignored this.


I edited /usr/share/lxc/templates/lxc-slackware replacing the list of packages with the below. I managed to create
a new container sucefully:
lxc-create -n test -t slackware

Quote:

regarding the packages template for the container this is the new one I used here
Code:
aaa_base
aaa_elflibs
aaa_terminfo
bash
bin
bzip2
cracklib
coreutils
cyrus-sasl
db48
dcron
dhcpcd
dialog
diffutils
e2fsprogs
elfutils
elvis
etc
eudev
findutils
gawk
glibc-solibs
gnupg
gnutls
grep
gzip
iproute2
iputils
kmod
libcap-ng
libffi
libmnl
libpsl
libpwquality
libtasn1
libtirpc
libunistring
logrotate
mpfr
net-tools
nettle
network-scripts
ncurses
openssh
openssl-solibs
pam
pcre2
p11-kit
pkgtools
procps-ng
sed
shadow
sharutils
slackpkg
sysklogd
sysvinit
sysvinit-functions
sysvinit-scripts
tar
util-linux
wget
which
xz
it can be in your case that just libtirpc is needed.
Here things get a little odd...

Quote:

BTW, here you can find a new version of the build script with the new template and the new init scripts (synced with the ones from Slackware current as today)

http://ponce.cc/slackware/testing/lxc/
I downloaded this and ran the slackbuild and upgraded to this new version. I think I had sucess creating a new container, maybe not. However, if I try now I get, from a similar command
Code:
lxc-create -n slc-base-20200629 -t slackware

...
Snip many lines.
...

xz-5.2.5-x86_64-1: compression utility based on the LZMA algorithm ........................................................... [1.2M]

Searching for NEW configuration files
                No .new files found.


Configuring...

Adding an etc/fstab that must be modified later with the
full path of the container's rootfs if you decide to move it.
cp: cannot stat '/usr/share/lxc/scripts/slackware/*': No such file or directory
Error creating container slc-base-20200629
 
Old 06-29-2020, 05:29 PM   #20
petejc
Member
 
Registered: Apr 2019
Distribution: Slackware
Posts: 111

Rep: Reputation: Disabled
Quote:
Originally Posted by petejc View Post

cp: cannot stat '/usr/share/lxc/scripts/slackware/*': No such file or directory
Error creating container slc-base-20200629
[/code]
For completeness:

Code:
bash-5.0$ ls -al /usr/share/lxc/scripts/slackware/
total 0
drwxr-xr-x 1 root root  0 Jun 29 21:00 .
drwxr-xr-x 1 root root 18 Jun 29 21:00 ..
 
Old 06-29-2020, 06:32 PM   #21
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by petejc View Post
For completeness:

Code:
bash-5.0$ ls -al /usr/share/lxc/scripts/slackware/
total 0
drwxr-xr-x 1 root root  0 Jun 29 21:00 .
drwxr-xr-x 1 root root 18 Jun 29 21:00 ..
Looks like an incomplete installation of LXC on the host. Normally, there should be modified rc.* scripts for the conainer, at least that is the case in 14.2. Try following ponce's link
ponce.cc/slackware/testing/lxc. These scripts should reside in /usr/share/lxc/scripts/slackware/. Copy them to that destination or better yet, try reinstalling the LXC package.

PS: Make sure that you downloaded all files in the linked destination.

Last edited by crts; 06-29-2020 at 06:35 PM.
 
Old 06-30-2020, 02:49 AM   #22
petejc
Member
 
Registered: Apr 2019
Distribution: Slackware
Posts: 111

Rep: Reputation: Disabled
Quote:
Originally Posted by crts View Post
Looks like an incomplete installation of LXC on the host. Normally, there should be modified rc.* scripts for the conainer, at least that is the case in 14.2. Try following ponce's link
ponce.cc/slackware/testing/lxc. These scripts should reside in /usr/share/lxc/scripts/slackware/. Copy them to that destination or better yet, try reinstalling the LXC package.

PS: Make sure that you downloaded all files in the linked destination.
Thanks due to yourself and ponce. It looks like I need to read up a little more on wget as the contents of scripts on ponce's link were not downloaded. I've now fixed that and rebuilt the slackbuild:

Code:
tar tf /tmp/lxc-2.0.11_fad08f383-x86_64-5.txz | grep scripts
usr/share/lxc/scripts/
usr/share/lxc/scripts/slackware/
usr/share/lxc/scripts/slackware/rc.6.lxc
usr/share/lxc/scripts/slackware/rc.M.lxc
usr/share/lxc/scripts/slackware/rc.S.lxc
usr/share/lxc/scripts/slackware/rc.inet1.lxc
I've not time to test now. Will test later.
 
Old 06-30-2020, 02:56 AM   #23
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,424

Rep: Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597
you can use lftp to clone the directory, like
Code:
lftp -c mirror http://ponce.cc/slackware/testing/lxc/
if anyone is feeling adventurous (well, actually is not that necessary as it seems to work smoothly) I'm also testing since a while the newer lxc versions, first 3.x and then 4.x (supported until 2025): you can find the interested SlackBuild here

http://ponce.cc/slackware/testing/lxc_new/

note that the syntax in the container config changes a little: the template is adapted accordingly, there's an example of config for passing to lxc-create and there's also a README with some pointers.

Last edited by ponce; 06-30-2020 at 03:07 AM.
 
2 members found this post helpful.
Old 08-29-2020, 03:10 PM   #24
Olek
Member
 
Registered: Jul 2012
Location: Wroclaw Poland
Distribution: Slackware
Posts: 90

Rep: Reputation: 15
[QUOTE=ponce;6139581]you can use lftp to clone the directory, like
Code:
lftp -c mirror http://ponce.cc/slackware/testing/lxc/
Made it and installed.

Code:
# cat /etc/lxc/lxc.conf
lxcpath = /home/lxc_containers
But...

Code:
MIRROR=file://home/user/slackware lxc-create -n slack64cur -t slackware -f /home/user/lxcslack.conf 

.... <cut installing packages> ....

Searching for NEW configuration files
                No .new files found.


Configuring...

Adding an etc/fstab that must be modified later with the
full path of the container's rootfs if you decide to move it.
BAD PASSWORD: The password is shorter than 6 characters
Root default password is 'root', please change it!

Copying rootfs to /var/lib/lxc/slack64cur/rootfs...
Why to /var/lib/lxc instead /home/lxc_containers?
 
Old 08-29-2020, 03:28 PM   #25
Olek
Member
 
Registered: Jul 2012
Location: Wroclaw Poland
Distribution: Slackware
Posts: 90

Rep: Reputation: 15
Quote:
Originally Posted by Olek View Post

Why to /var/lib/lxc instead /home/lxc_containers?
I think I know.
In file /etc/lxc/lxc.conf.sample there is
Code:
lxcpath = /var/lib/lxc
but should be
Code:
lxc.lxcpath = /var/lib/lxc
 
Old 08-29-2020, 03:45 PM   #26
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by Olek View Post
Why to /var/lib/lxc instead /home/lxc_containers?
Because that is the default location. If you want to install somewhere else you need to use the -P option.
From the manpage:
Code:
       -P, --lxcpath=PATH
              Use an alternate container path. The default is /var/lib/lxc.
 
Old 08-29-2020, 07:59 PM   #27
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 1,910

Original Poster
Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Quote:
Originally Posted by crts View Post
Because that is the default location. If you want to install somewhere else you need to use the -P option.
From the manpage:
Code:
       -P, --lxcpath=PATH
              Use an alternate container path. The default is /var/lib/lxc.
Yes, but then you have to supply that path any time you try to run an lxc command for that container. It's better to just change it in the configuration file if you want it to be permanent.
 
Old 08-30-2020, 06:24 AM   #28
Olek
Member
 
Registered: Jul 2012
Location: Wroclaw Poland
Distribution: Slackware
Posts: 90

Rep: Reputation: 15
Quote:
Originally Posted by crts View Post
Because that is the default location. If you want to install somewhere else you need to use the -P option.
From the manpage:
Code:
       -P, --lxcpath=PATH
              Use an alternate container path. The default is /var/lib/lxc.
No, I don't need to use -P option.
Following by this howto https://docs.slackware.com/howtos:misc:lxc it's enough to set
Code:
lxc.lxcpath = /home/lxc_containers
in /etc/lxc/lxc.conf

It is enough that the sample file /etc/lxc/lxc.conf.sample does not suggest the wrong option name.
The /etc/lxc/lxc.conf.sample file should have
Code:
lxc.lxcpath =
instead of
Code:
lxcpath =
Now that I have corrected the entry in my file /etc/lxc/lxc.conf
from
Code:
lxcpath =
to
Code:
lxc.lxcpath =
containers are saved in the correct directory.
 
Old 08-30-2020, 06:44 AM   #29
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,424

Rep: Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597Reputation: 3597
Quote:
Originally Posted by Olek View Post
No, I don't need to use -P option.
Following by this howto https://docs.slackware.com/howtos:misc:lxc it's enough to set
Code:
lxc.lxcpath = /home/lxc_containers
in /etc/lxc/lxc.conf

It is enough that the sample file /etc/lxc/lxc.conf.sample does not suggest the wrong option name.
The /etc/lxc/lxc.conf.sample file should have
Code:
lxc.lxcpath =
instead of
Code:
lxcpath =
thanks for the report, I fixed it in the SlackBuilds in the /testing directory!
 
Old 08-30-2020, 07:05 AM   #30
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by Olek View Post
No, I don't need to use -P option.
Sorry about that, it was late and I did not realize that you wanted to permanently change the default for all containers. I use a mix of privileged and unprivileged containers and use the default location for the privileged ones and the -P for the unprivileged containers, so I am biased towards the -P option.

Quote:
Originally Posted by Olek View Post
Now that I have corrected the entry in my file /etc/lxc/lxc.conf
from
Code:
lxcpath =
to
Code:
lxc.lxcpath =
containers are saved in the correct directory.
Yes, and it is documented in lxc.system.conf*, in case you need more options:
Code:
lxc.system.conf(5)                                          lxc.system.conf(5)

NAME
       lxc.system.conf - LXC system configuration file

DESCRIPTION
       The  system  configuration  is  located at /etc/lxc/lxc.conf or ~/.con‐
       fig/lxc/lxc.conf for unprivileged containers.

       This configuration file is used to set values such  as  default  lookup
       paths and storage backend settings for LXC.

   CONFIGURATION PATHS
       lxc.lxcpath
              The location in which all containers are stored.

       lxc.default_config
              The path to the default container configuration.

...
* using Slackware 14.2, I assume it is the same location for -current.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] new rc.* scripts added to -current in LXC container linuxtinker Slackware 1 06-16-2018 11:24 AM
[SOLVED] "lxc list" vs "lxc-ls" yknivag Linux - Virtualization and Cloud 1 03-09-2017 06:53 AM
Creating a CentoS 7 LXC container in an EC2 instance PeterSteele Linux - Virtualization and Cloud 2 08-12-2015 09:25 AM
script to get a lxc-container like iso of current. cod_liver_0il Slackware 1 09-10-2012 12:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration