Container reboot repeatedly with lxc-2.0.7 start

Hi all,
I created a container with lxc-2.07 on android 9.0 mobile phone which based on ARM_64 platform, the kerne version is 4.4 for android mobile phone, and the lxc-checkconfig fully meets the requirements. when I start the container, it will reboot repeatedly. the following is the the important log:

lxc_start - start.c:post_start:1439 - Started “/init” with pid “4519”.
lxc_start - start.c:signal_handler:322 - Invalid pid for SIGCHLD. Received pid 4506, expected pid 4519.
lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc_commands - commands.c:lxc_cmd_get_state:578 - Container “con1” is in “RUNNING” state.
lxc_start - start.c:signal_handler:326 - Container init process 4519 exited.
lxc_start - start.c:__lxc_start:1375 - Container “con1” is rebooting.

At the same time, I find that the PID was constantly changing as below:
Name: con1
State: RUNNING
PID: 6308
IP: 192.168.9.2
CPU use: 0.37 seconds

Name: con1
State: RUNNING
PID: 6229
IP: 192.168.9.2
CPU use: 0.36 seconds

Name: con1
State: RUNNING
PID: 6150
IP: 192.168.9.2
CPU use: 0.34 seconds

Not sure how to debug this issue. any way to debug and resolve this?
Thanks a lot.
BRs,
Deven

The following is a more detailed log capture:
lxc-start 20200316143420.310 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:309 - Going to wait for pid 4501.
lxc-start 20200316143420.321 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:328 - Trying to sync with child process.
lxc-start 20200316143420.327 INFO lxc_start - start.c:lxc_check_inherited:235 - Closed inherited fd: 4.
lxc-start 20200316143420.329 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:366 - Using pipe file descriptor 5 for monitord.
lxc-start 20200316143420.404 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:343 - Sucessfully synced with child process.
lxc-start 20200316143420.413 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:312 - Finished waiting on pid 4501.
lxc-start 20200316143420.422 INFO lxc_container - lxccontainer.c:do_lxcapi_start:804 - Attempting to set proc title to [lxc monitor] /odm2/containers con1
lxc-start 20200316143420.443 DEBUG lxc_start - start.c:setup_signal_fd:273 - Set SIGCHLD handler with file descriptor: 5.
lxc-start 20200316143420.446 DEBUG console - console.c:lxc_console_peer_default:468 - no console peer
lxc-start 20200316143420.447 INFO lxc_start - start.c:lxc_init:475 - Container “con1” is initialized.
lxc-start 20200316143420.452 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:309 - Going to wait for pid 4505.
lxc-start 20200316143420.460 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:328 - Trying to sync with child process.
lxc-start 20200316143420.464 INFO lxc_start - start.c:lxc_check_inherited:235 - Closed inherited fd: 4.
lxc-start 20200316143420.465 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:366 - Using pipe file descriptor 5 for monitord.
lxc-start 20200316143420.467 DEBUG lxc_start - start.c:__lxc_start:1317 - Not dropping CAP_SYS_BOOT or watching utmp.
lxc-start 20200316143420.513 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:343 - Sucessfully synced with child process.
lxc-start 20200316143420.527 INFO lxc_conf - conf.c:instantiate_veth:2647 - Retrieved mtu 1500 from br0
lxc-start 20200316143420.530 DEBUG lxc_monitor - monitor.c:lxc_monitord_spawn:312 - Finished waiting on pid 4505.
lxc-start 20200316143420.530 INFO lxc_monitor - monitor.c:lxc_monitor_sock_name:185 - Using monitor socket name “lxc/abb98aa26dc9f857//odm2/containers”.
lxc-start 20200316143420.541 INFO lxc_conf - conf.c:instantiate_veth:2672 - Attached ‘vethAI4ADV’: to the bridge ‘br0’:
lxc-start 20200316143420.544 DEBUG lxc_conf - conf.c:instantiate_veth:2689 - instantiated veth ‘vethAI4ADV/veth57BT9O’, index is ‘27’
lxc-start 20200316143420.544 INFO lxc_cgroup - cgroups/cgroup.c:cgroup_init:68 - cgroup driver cgroupfs initing for con1
lxc-start 20200316143420.600 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWNS.
lxc-start 20200316143420.600 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWPID.
lxc-start 20200316143420.600 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWUTS.
lxc-start 20200316143420.600 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWIPC.
lxc-start 20200316143420.600 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWNET.
lxc-start 20200316143420.697 DEBUG lxc_conf - conf.c:lxc_assign_network:3185 - move ‘veth57BT9O’/’(null)’ to ‘4519’: .
lxc-start 20200316143420.791 DEBUG bdev - bdev/bdev.c:find_fstype_cb:902 - trying to mount ‘/dev/block/loop0’->’/data/maru/con1/lxc-rootfs.mount’ with fstype ‘ext3’
lxc-start 20200316143420.792 DEBUG bdev - bdev/bdev.c:find_fstype_cb:910 - mount failed with error: Device or resource busy
lxc-start 20200316143420.793 DEBUG bdev - bdev/bdev.c:find_fstype_cb:902 - trying to mount ‘/dev/block/loop0’->’/data/maru/con1/lxc-rootfs.mount’ with fstype ‘ext2’
lxc-start 20200316143420.793 DEBUG bdev - bdev/bdev.c:find_fstype_cb:910 - mount failed with error: Device or resource busy
lxc-start 20200316143420.793 DEBUG bdev - bdev/bdev.c:find_fstype_cb:902 - trying to mount ‘/dev/block/loop0’->’/data/maru/con1/lxc-rootfs.mount’ with fstype ‘ext4’
lxc-start 20200316143420.795 INFO bdev - bdev/bdev.c:find_fstype_cb:918 - mounted ‘/dev/block/loop0’ on ‘/data/maru/con1/lxc-rootfs.mount’, with fstype ‘ext4’
lxc-start 20200316143420.795 DEBUG lxc_conf - conf.c:setup_rootfs:1283 - mounted ‘/dev/block/loop0’ on ‘/data/maru/con1/lxc-rootfs.mount’
lxc-start 20200316143420.796 INFO lxc_conf - conf.c:setup_utsname:901 - ‘con1’ hostname has been setup
lxc-start 20200316143420.820 DEBUG lxc_conf - conf.c:setup_netdev:2452 - ‘eth0’ has been setup
lxc-start 20200316143420.821 INFO lxc_conf - conf.c:setup_network:2473 - network has been setup
lxc-start 20200316143420.821 INFO lxc_conf - conf.c:mount_autodev:1130 - Mounting container /dev
lxc-start 20200316143420.891 INFO lxc_conf - conf.c:mount_autodev:1153 - Mounted tmpfs onto /data/maru/con1/lxc-rootfs.mount/dev
lxc-start 20200316143420.892 INFO lxc_conf - conf.c:mount_autodev:1171 - Mounted container /dev
lxc-start 20200316143420.934 INFO lxc_conf - conf.c:fill_autodev:1199 - Creating initial consoles under container /dev
lxc-start 20200316143420.935 INFO lxc_conf - conf.c:fill_autodev:1210 - Populating container /dev
lxc-start 20200316143420.936 INFO lxc_conf - conf.c:fill_autodev:1247 - Populated container /dev
lxc-start 20200316143420.938 INFO lxc_conf - conf.c:setup_dev_console:1495 - console has been setup
lxc-start 20200316143420.940 INFO lxc_utils - utils.c:mount_proc_if_needed:1790 - I am 1, /proc/self points to ‘1’
lxc-start 20200316143420.946 DEBUG lxc_conf - conf.c:setup_rootfs_pivot_root:1108 - pivot_root syscall to ‘/data/maru/con1/lxc-rootfs.mount’ successful
lxc-start 20200316143420.973 DEBUG lxc_conf - conf.c:lxc_create_tty:3429 - allocated pty ‘/dev/pts/0’ (9/12)
lxc-start 20200316143420.974 DEBUG lxc_conf - conf.c:lxc_create_tty:3429 - allocated pty ‘/dev/pts/1’ (13/14)
lxc-start 20200316143420.974 DEBUG lxc_conf - conf.c:lxc_create_tty:3429 - allocated pty ‘/dev/pts/2’ (15/16)
lxc-start 20200316143420.975 DEBUG lxc_conf - conf.c:lxc_create_tty:3429 - allocated pty ‘/dev/pts/3’ (17/18)
lxc-start 20200316143420.975 INFO lxc_conf - conf.c:lxc_create_tty:3440 - tty’s configured
lxc-start 20200316143420.978 INFO lxc_conf - conf.c:setup_tty:1053 - 4 tty(s) has been setup
lxc-start 20200316143420.978 DEBUG lxc_conf - conf.c:setup_caps:2144 - capabilities have been setup
lxc-start 20200316143420.978 NOTICE lxc_conf - conf.c:lxc_setup:3977 - ‘con1’ is setup.
lxc-start 20200316143420.981 NOTICE lxc_start - start.c:start:1428 - Exec’ing “/init”.
lxc-start 20200316143421.276 NOTICE lxc_start - start.c:post_start:1439 - Started “/init” with pid “4519”.
lxc-start 20200316143421.287 WARN lxc_start - start.c:signal_handler:322 - Invalid pid for SIGCHLD. Received pid 4506, expected pid 4519.
lxc-start 20200316143421.311 DEBUG lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc-start 20200316143421.356 DEBUG lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc-start 20200316143421.371 DEBUG lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc-start 20200316143421.389 DEBUG lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc-start 20200316143421.419 DEBUG lxc_commands - commands.c:lxc_cmd_handler:893 - Peer has disconnected.
lxc-start 20200316143421.419 DEBUG lxc_commands - commands.c:lxc_cmd_get_state:578 - Container “con1” is in “RUNNING” state.
lxc-start 20200316143421.960 DEBUG lxc_start - start.c:signal_handler:326 - Container init process 4519 exited.
lxc-start 20200316143421.961 DEBUG lxc_start - start.c:__lxc_start:1375 - Container “con1” is rebooting.
lxc-start 20200316143421.962 DEBUG lxc_start - start.c:__lxc_start:1387 - Pushing physical nics back to host namespace
lxc-start 20200316143421.962 DEBUG lxc_start - start.c:__lxc_start:1390 - Tearing down virtual network devices used by container “con1”.
lxc-start 20200316143421.962 INFO lxc_conf - conf.c:lxc_delete_network:3005 - Interface “(null)” with index 27 already deleted or existing in different network namespace.
lxc-start 20200316143422.275 INFO lxc_conf - conf.c:lxc_delete_network:3040 - Removed interface “vethAI4ADV” from host.
lxc-start 20200316143422.276 INFO lxc_error - error.c:lxc_error_set_and_log:54 - Child <4519> ended on signal (1).
lxc-start 20200316143422.374 INFO lxc_container - lxccontainer.c:do_lxcapi_start:884 - container requested reboot
lxc-start 20200316143422.375 INFO lxc_start - start.c:lxc_check_inherited:235 - Closed inherited fd: 5.
lxc-start 20200316143422.376 INFO lxc_start - start.c:lxc_check_inherited:235 - Closed inherited fd: 24.
lxc-start 20200316143422.378 DEBUG lxc_start - start.c:setup_signal_fd:273 - Set SIGCHLD handler with file descriptor: 5.
lxc-start 20200316143422.380 DEBUG console - console.c:lxc_console_peer_default:468 - no console peer
lxc-start 20200316143422.380 INFO lxc_start - start.c:lxc_init:475 - Container “con1” is initialized.
lxc-start 20200316143422.400 DEBUG lxc_start - start.c:__lxc_start:1317 - Not dropping CAP_SYS_BOOT or watching utmp.
lxc-start 20200316143422.430 INFO lxc_conf - conf.c:instantiate_veth:2647 - Retrieved mtu 1500 from br0
lxc-start 20200316143422.439 INFO lxc_conf - conf.c:instantiate_veth:2672 - Attached ‘veth79QY0C’: to the bridge ‘br0’:
lxc-start 20200316143422.443 DEBUG lxc_conf - conf.c:instantiate_veth:2689 - instantiated veth ‘veth79QY0C/vethPS1H80’, index is ‘29’
lxc-start 20200316143422.443 INFO lxc_cgroup - cgroups/cgroup.c:cgroup_init:68 - cgroup driver cgroupfs initing for con1
lxc-start 20200316143423.766 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWNS.
lxc-start 20200316143423.766 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWPID.
lxc-start 20200316143423.766 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWUTS.
lxc-start 20200316143423.766 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWIPC.
lxc-start 20200316143423.767 INFO lxc_start - start.c:lxc_spawn:1154 - Cloned CLONE_NEWNET.
lxc-start 20200316143423.873 DEBUG lxc_conf - conf.c:lxc_assign_network:3185 - move ‘vethPS1H80’/’(null)’ to ‘4572’: .
lxc-start 20200316143423.971 DEBUG bdev - bdev/bdev.c:find_fstype_cb:902 - trying to mount ‘/dev/block/loop0’->’/data/maru/con1/lxc-rootfs.mount’ with fstype ‘ext3’
lxc-start 20200316143423.972 DEBUG bdev - bdev/bdev.c:find_fstype_cb:910 - mount failed with error: Device or resource busy
lxc-start 20200316143423.973 DEBUG bdev - bdev/bdev.c:find_fstype_cb:902 - trying to mount ‘/dev/block/loop0’->’/data/maru/con1/lxc-rootfs.mount’ with fstype ‘ext2’
lxc-start 20200316143423.973 DEBUG bdev - bdev/bdev.c:find_fstype_cb:910 - mount failed with error: Device or resource busy
lxc-start 20200316143423.974 DEBUG bdev - bdev/bdev.c:find_fstype_cb:902 - trying to mount ‘/dev/block/loop0’->’/data/maru/con1/lxc-rootfs.mount’ with fstype ‘ext4’
lxc-start 20200316143423.975 INFO bdev - bdev/bdev.c:find_fstype_cb:918 - mounted ‘/dev/block/loop0’ on ‘/data/maru/con1/lxc-rootfs.mount’, with fstype ‘ext4’
lxc-start 20200316143423.975 DEBUG lxc_conf - conf.c:setup_rootfs:1283 - mounted ‘/dev/block/loop0’ on ‘/data/maru/con1/lxc-rootfs.mount’
lxc-start 20200316143423.975 INFO lxc_conf - conf.c:setup_utsname:901 - ‘con1’ hostname has been setup
lxc-start 20200316143424.213 DEBUG lxc_conf - conf.c:setup_netdev:2452 - ‘eth0’ has been setup
lxc-start 20200316143424.259 INFO lxc_conf - conf.c:setup_network:2473 - network has been setup
lxc-start 20200316143424.304 INFO lxc_conf - conf.c:mount_autodev:1130 - Mounting container /dev
lxc-start 20200316143424.373 INFO lxc_conf - conf.c:mount_autodev:1153 - Mounted tmpfs onto /data/maru/con1/lxc-rootfs.mount/dev
lxc-start 20200316143424.378 INFO lxc_conf - conf.c:mount_autodev:1171 - Mounted container /dev
lxc-start 20200316143424.668 INFO lxc_conf - conf.c:fill_autodev:1199 - Creating initial consoles under container /dev
lxc-start 20200316143424.669 INFO lxc_conf - conf.c:fill_autodev:1210 - Populating container /dev
lxc-start 20200316143424.681 INFO lxc_conf - conf.c:fill_autodev:1247 - Populated container /dev
lxc-start 20200316143424.693 INFO lxc_conf - conf.c:setup_dev_console:1495 - console has been setup
lxc-start 20200316143424.707 INFO lxc_utils - utils.c:mount_proc_if_needed:1790 - I am 1, /proc/self points to ‘1’
lxc-start 20200316143424.746 DEBUG lxc_conf - conf.c:setup_rootfs_pivot_root:1108 - pivot_root syscall to ‘/data/maru/con1/lxc-rootfs.mount’ successful
lxc-start 20200316143424.988 DEBUG lxc_conf - conf.c:lxc_create_tty:3429 - allocated pty ‘/dev/pts/0’ (9/12)
lxc-start 20200316143424.995 DEBUG lxc_conf - conf.c:lxc_create_tty:3429 - allocated pty ‘/dev/pts/1’ (13/14)
lxc-start 20200316143424.100 DEBUG lxc_conf - conf.c:lxc_create_tty:3429 - allocated pty ‘/dev/pts/2’ (15/16)
lxc-start 20200316143424.100 DEBUG lxc_conf - conf.c:lxc_create_tty:3429 - allocated pty ‘/dev/pts/3’ (17/18)
lxc-start 20200316143424.100 INFO lxc_conf - conf.c:lxc_create_tty:3440 - tty’s configured
lxc-start 20200316143424.103 INFO lxc_conf - conf.c:setup_tty:1053 - 4 tty(s) has been setup
lxc-start 20200316143424.104 DEBUG lxc_conf - conf.c:setup_caps:2144 - capabilities have been setup
lxc-start 20200316143424.104 NOTICE lxc_conf - conf.c:lxc_setup:3977 - ‘con1’ is setup.
lxc-start 20200316143424.111 NOTICE lxc_start - start.c:start:1428 - Exec’ing “/init”.
lxc-start 20200316143424.119 NOTICE lxc_start - start.c:post_start:1439 - Started “/init” with pid “4572”.
lxc-start 20200316143424.123 WARN lxc_start - start.c:signal_handler:322 - Invalid pid for SIGCHLD. Received pid 4552, expected pid 4572.
lxc-start 20200316143424.991 DEBUG lxc_start - start.c:signal_handler:326 - Container init process 4572 exited.
lxc-start 20200316143424.997 DEBUG lxc_start - start.c:__lxc_start:1375 - Container “con1” is rebooting.

This suggests that LXC is working fine but your container’s init system is causing a reboot.

You may want to either use another init system temporarily in the container to see what’s going on or find some way to setup debug logging in your container’s init system.

Hi Stgraber,
Thanks a lot for your proposal,I will double check my container’s init system.