Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nelsnelson
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelsnelson/9056240 to your computer and use it in GitHub Desktop.
Save nelsnelson/9056240 to your computer and use it in GitHub Desktop.
Example of lxc-execute failure due to "lxc-execute: Failed to find an lxc-init"
$ cat seccomp.sh
#! /usr/bin/env bash
cat << EOF > /tmp/config
lxc.seccomp = /tmp/whitelist
EOF
cat << EOF > /tmp/whitelist
1
whitelist
1
EOF
# this works-ish!
cmd="sudo lxc-execute -n echotest -l DEBUG -o /tmp/lxc.log -- cat /etc/hostname"
echo
echo "Executing lxc instance with command: ${cmd}"
echo `${cmd}`
echo
echo "Debug output:"
cat /tmp/lxc.log
echo
# this fails!
cmd="sudo lxc-execute -n echotest -f /tmp/config -l DEBUG -o /tmp/lxc.log -- cat /etc/hostname"
echo
echo "Executing lxc instance with command: ${cmd}"
echo `${cmd}`
echo
echo "Debug output:"
cat /tmp/lxc.log
echo
# cleanup
rm -f /tmp/config
rm -f /tmp/whitelist
sudo rm -f /tmp/lxc.log
$ ./seccomp.sh
Executing lxc instance with command: sudo lxc-execute -n echotest -l DEBUG -o /tmp/lxc.log -- cat /etc/hostname
yama
Debug output:
lxc-execute 1391684521.503 INFO lxc_lsm - LSM security driver nop
lxc-execute 1391684521.503 DEBUG lxc_start - sigchild handler set
lxc-execute 1391684521.503 INFO lxc_console - no console for lxc-execute.
lxc-execute 1391684521.503 INFO lxc_start - 'echotest' is initialized
lxc-execute 1391684521.509 DEBUG lxc_start - Not dropping cap_sys_boot or watching utmp
lxc-execute 1391684521.512 DEBUG lxc_conf - Set exec command to cat
lxc-execute 1391684521.512 DEBUG lxc_conf - capabilities have been setup
lxc-execute 1391684521.512 NOTICE lxc_conf - 'echotest' is setup.
lxc-execute 1391684521.512 NOTICE lxc_execute - exec'ing 'cat'
lxc-execute 1391684521.514 NOTICE lxc_execute - 'cat' started with pid '5257'
lxc-execute 1391684521.514 INFO lxc_console - no console for lxc-execute.
lxc-execute 1391684521.514 WARN lxc_start - invalid pid for SIGCHLD
lxc-execute 1391684521.519 DEBUG lxc_start - container init process exited
lxc-execute 1391684521.519 INFO lxc_conf - running to reset 0 nic names
Executing lxc instance with command: sudo lxc-execute -n echotest -f /tmp/config -l DEBUG -o /tmp/lxc.log -- cat /etc/hostname
lxc-execute: Failed to find an lxc-init
lxc-execute: invalid sequence number 1. expected 4
lxc-execute: failed to spawn 'echotest'
Debug output:
lxc-execute 1391684521.503 INFO lxc_lsm - LSM security driver nop
lxc-execute 1391684521.503 DEBUG lxc_start - sigchild handler set
lxc-execute 1391684521.503 INFO lxc_console - no console for lxc-execute.
lxc-execute 1391684521.503 INFO lxc_start - 'echotest' is initialized
lxc-execute 1391684521.509 DEBUG lxc_start - Not dropping cap_sys_boot or watching utmp
lxc-execute 1391684521.512 DEBUG lxc_conf - Set exec command to cat
lxc-execute 1391684521.512 DEBUG lxc_conf - capabilities have been setup
lxc-execute 1391684521.512 NOTICE lxc_conf - 'echotest' is setup.
lxc-execute 1391684521.512 NOTICE lxc_execute - exec'ing 'cat'
lxc-execute 1391684521.514 NOTICE lxc_execute - 'cat' started with pid '5257'
lxc-execute 1391684521.514 INFO lxc_console - no console for lxc-execute.
lxc-execute 1391684521.514 WARN lxc_start - invalid pid for SIGCHLD
lxc-execute 1391684521.519 DEBUG lxc_start - container init process exited
lxc-execute 1391684521.519 INFO lxc_conf - running to reset 0 nic names
lxc-execute 1391684521.528 INFO lxc_lsm - LSM security driver nop
lxc-execute 1391684521.528 DEBUG lxc_start - sigchild handler set
lxc-execute 1391684521.528 INFO lxc_console - no console for lxc-execute.
lxc-execute 1391684521.528 INFO lxc_start - 'echotest' is initialized
lxc-execute 1391684521.530 DEBUG lxc_start - Not dropping cap_sys_boot or watching utmp
lxc-execute 1391684521.597 DEBUG lxc_conf - Set exec command to cat
lxc-execute 1391684521.597 DEBUG lxc_conf - capabilities have been setup
lxc-execute 1391684521.597 NOTICE lxc_conf - 'echotest' is setup.
lxc-execute 1391684521.597 ERROR lxc_execute - Failed to find an lxc-init
lxc-execute 1391684521.597 ERROR lxc_sync - invalid sequence number 1. expected 4
lxc-execute 1391684521.597 ERROR lxc_start - failed to spawn 'echotest'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment