89luca89 / lilipod

Lilipod is a simple container manager, able to download, unpack and use OCI images from various container registries.
GNU General Public License v3.0
240 stars 11 forks source link

[Ubuntu 22.04] failed to find dependency getsubids, can't recover #7

Closed osalbahr closed 3 months ago

osalbahr commented 9 months ago

How can I install getsubids on Ubuntu 22.04? I couldn't find it in the repos:

osalbahr@vclvm176-53:~/lilipod$ ./lilipod-linux-amd64
failed to find dependency getsubids, can't recover.
2023/10/08 11:01:06 exec: "getsubids": executable file not found in $PATH
osalbahr@vclvm176-53:~/lilipod$ getsubids
getsubids: command not found
osalbahr@vclvm176-53:~/lilipod$ command_not_found_handle getsubids
getsubids: command not found
osalbahr@vclvm176-53:~/lilipod$ apt-file search getsubids
osalbahr@vclvm176-53:~/lilipod$           

As per the dependencies section, I tried to install uidmap but it doesn't seem to contain getsubids either:

osalbahr@vclvm176-53:~/lilipod$ sudo apt install uidmap
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
uidmap is already the newest version (1:4.8.1-2ubuntu2.1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
osalbahr@vclvm176-53:~/lilipod$ getsubids
getsubids: command not found

System info:

                             ....             osalbahr@vclvm176-53 
              .',:clooo:  .:looooo:.          -------------------- 
           .;looooooooc  .oooooooooo'         OS: Ubuntu 22.04.3 LTS x86_64 
        .;looooool:,''.  :ooooooooooc         Host: KVM RHEL 7.6.0 PC (i440FX + PIIX, 1996) 
       ;looool;.         'oooooooooo,         Kernel: 5.15.0-84-generic 
      ;clool'             .cooooooc.  ,,      Uptime: 3 days, 8 hours, 20 mins 
         ...                ......  .:oo,     Packages: 3432 (dpkg), 190 (brew) 
  .;clol:,.                        .loooo'    Shell: bash 5.1.16 
 :ooooooooo,                        'ooool    Resolution: 1024x768 
'ooooooooooo.                        loooo.   Terminal: /dev/pts/1 
'ooooooooool                         coooo.   CPU: 2x Intel (Haswell, IBRS) (2) @ 2.4GHz 
 ,loooooooc.                        .loooo.   GPU: Cirrus Logic QEMU Virtual Machine 
   .,;;;'.                          ;ooooc    Memory: 1.12 GiB / 7.75 GiB (14%) 
       ...                         ,ooool.    Network: 2x Unknown 
    .cooooc.              ..',,'.  .cooo.     BIOS: SeaBIOS 0.0 (04/01/2014) 
      ;ooooo:.           ;oooooooc.  :l.
       .coooooc,..      coooooooooo.                                  
         .:ooooooolc:. .ooooooooooo'                                  
           .':loooooo;  ,oooooooooc
               ..';::c'  .;loooo:'
                             .

Any suggestions?

osalbahr commented 9 months ago

On Fedora it is shadow-utils-subid, but I can't find something similar for Ubuntu.

[root@60c6f2bf20b5 lilipod]# dnf whatprovides getsubids
Last metadata expiration check: 0:14:04 ago on Sun Oct  8 15:17:16 2023.
shadow-utils-subid-2:4.14.0-2.fc40.i686 : A library to manage subordinate uid and gid ranges
Repo        : rawhide
Matched from:
Filename    : /usr/bin/getsubids

shadow-utils-subid-2:4.14.0-2.fc40.x86_64 : A library to manage subordinate uid and gid ranges
Repo        : rawhide
Matched from:
Filename    : /usr/bin/getsubids

Somehow, though, it looks like the uidmap package on Debian does include getsubids.

root@a1f4bd0a4239:~# command-not-found getsubids
Command 'getsubids' not found, but can be installed with:
apt install uidmap
root@a1f4bd0a4239:~# apt-file search getsubids
manpages-tr: /usr/share/man/tr/man1/getsubids.1.gz
uidmap: /usr/bin/getsubids
uidmap: /usr/share/man/man1/getsubids.1.gz
mirkobrombin commented 7 months ago

By looking at the Ubuntu Manpage, the package is uidmap in Ubuntu 22.04.

patatetom commented 6 months ago

getsubids is available from uidmap_1:4.13@bookworm but not before (in uidmap_1:4.8@bullseye for example). I've this little pure bash script getsubids.sh compiled with shc in .local/bin/getsubids which do the job :

#!/bin/bash
# shc -vrf getsubids.sh -o getsubids
re="^$USER:"
index=0
while IFS= read -r line || [ -n "$line" ]
do
  [[ $line =~ $re ]] &&
    echo "$index ${line//:/ }" &&
      exit 0
  index=$((index+1))
done < /etc/subuid
exit 1

but now, I've a problem with setup cgroupfs: mkdir /sys/fs/cgroup/container-xxxxxx_yyyyyy.scope: permission denied, like here https://github.com/89luca89/lilipod/issues/11.

89luca89 commented 3 months ago

This issue is documented (dependency to getsubuid/gid) for the cgroup one we discuss on the other