Running as PID 1

SanderNL

New Member
Dec 25, 2022
4
0
1
I'm doing some tinkering with converting a Docker container into an LXC container. Albeit ofcourse via doing some dirty tricks. But nevertheless very educational.
To get the LXC container to run, i've had to install the package `init`. If i now look in the container i see the /sbin/init to be symlink to /lib/systemd/systemd. If i do `ps -aux` i see that `/sbin/init` is running with PID 1.

I now start the LXC container within Proxmox and check for the processes (ps -aux), i can see that "/sbin/init" is running with PID 1. Perfect!

The Docker container makes use of the "s6-overlay" tool for "init". The s6-overlay tool checks for the PID to be `1`. But i'm kind of stuck on this hurdle.
I've provided the config-parameter "lxc.init_cmd: /init".
When i start the LXC container with `pct start 999 --debug` i see the following output:

Code:
NOTICE   conf - ../src/lxc/conf.c:lxc_setup:4511 - The container "999" is set up
INFO     apparmor - ../src/lxc/lsm/apparmor.c:apparmor_process_label_set_at:1189 - Set AppArmor label to "lxc-999_</var/lib/lxc>//&:lxc
-999_<-var-lib-lxc>:"
INFO     apparmor - ../src/lxc/lsm/apparmor.c:apparmor_process_label_set:1234 - Changed AppArmor profile to lxc-999_</var/lib/lxc>//&:l
xc-999_<-var-lib-lxc>:
DEBUG    terminal - ../src/lxc/terminal.c:lxc_terminal_peer_default:696 - No such device - The process does not have a controlling term
inal
NOTICE   utils - ../src/lxc/utils.c:lxc_drop_groups:1367 - Dropped supplimentary groups
NOTICE   start - ../src/lxc/start.c:start:2194 - Exec'ing "/init"
NOTICE   start - ../src/lxc/start.c:post_start:2205 - Started "/init" with pid "1157714"
NOTICE   start - ../src/lxc/start.c:signal_handler:446 - Received 17 from pid 1157699 instead of container init 1157714

But that doesn't work. Is there maybe some more trickery i can try?
 
Last edited:
Never mind... I was actually further along than i thought..
After adding the config of below, i could see that the init-process actually worked :-S
Code:
lxc.init.cmd: /init
lxc.log.level: 3
lxc.console.logfile: /var/log/frigate.log
cat /var/log/frigate.log
I saw there the error:

Code:
Traceback (most recent call last):
  File "/usr/local/go2rtc/create_config.py", line 12, in <module>
    from frigate.ffmpeg_presets import (  # noqa: E402
  File "/opt/frigate/frigate/ffmpeg_presets.py", line 47, in <module>
    if int(os.getenv("LIBAVFORMAT_VERSION_MAJOR", "59")) >= 59
ValueError: invalid literal for int() with base 10: ''
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!