<div dir="ltr"><div><div><div><div><div><div>There is case:<br></div>I've some gradle script which launches lxc containers, manages them, etc. (spins test machines)<br></div>Finally i wanted to wrap it with jenkins and there start some problems. When I try to use lxc-info or lxc-kill commands they just stall.<br>
</div>There is some straces:<br># strace -f lxc-info -n keymanagementservice-main<br>execve("/usr/bin/lxc-info", ["lxc-info", "-n", "keymanagementservice-main"], [/* 37 vars */]) = 0<br>
brk(0) = 0x87c000<br>mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcb179ca000<br>access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)<br>
open("/etc/ld.so.cache", O_RDONLY) = 3<br>fstat(3, {st_mode=S_IFREG|0644, st_size=42597, ...}) = 0<br>mmap(NULL, 42597, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fcb179bf000<br>close(3) = 0<br>
open("/usr/lib64/liblxc.so.1", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\311\0\0\0\0\0\0"..., 832) = 832<br>fstat(3, {st_mode=S_IFREG|0755, st_size=1237456, ...}) = 0<br>
mmap(NULL, 2491720, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fcb1775e000<br>mprotect(0x7fcb177bc000, 2097152, PROT_NONE) = 0<br>mmap(0x7fcb179bc000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5e000) = 0x7fcb179bc000<br>
close(3) = 0<br>open("/lib64/librt.so.1", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@! X>\0\0\0"..., 832) = 832<br>fstat(3, {st_mode=S_IFREG|0755, st_size=47064, ...}) = 0<br>
mmap(0x3e58200000, 2128816, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e58200000<br>mprotect(0x3e58207000, 2093056, PROT_NONE) = 0<br>mmap(0x3e58406000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x3e58406000<br>
close(3) = 0<br>open("/lib64/libutil.so.1", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\16 \3636\0\0\0"..., 832) = 832<br>fstat(3, {st_mode=S_IFREG|0755, st_size=17520, ...}) = 0<br>
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcb1775d000<br>mmap(0x36f3200000, 2105600, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x36f3200000<br>mprotect(0x36f3202000, 2093056, PROT_NONE) = 0<br>
mmap(0x36f3401000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x36f3401000<br>close(3) = 0<br>open("/lib64/libpthread.so.0", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340] U>\0\0\0"..., 832) = 832<br>
fstat(3, {st_mode=S_IFREG|0755, st_size=145896, ...}) = 0<br>mmap(0x3e55200000, 2212848, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e55200000<br>mprotect(0x3e55217000, 2097152, PROT_NONE) = 0<br>mmap(0x3e55417000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x3e55417000<br>
mmap(0x3e55419000, 13296, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e55419000<br>close(3) = 0<br>open("/lib64/libc.so.6", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\356\341\3606\0\0\0"..., 832) = 832<br>
fstat(3, {st_mode=S_IFREG|0755, st_size=1926800, ...}) = 0<br>mmap(0x36f0e00000, 3750152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x36f0e00000<br>mprotect(0x36f0f8b000, 2093056, PROT_NONE) = 0<br>mmap(0x36f118a000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18a000) = 0x36f118a000<br>
mmap(0x36f118f000, 18696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x36f118f000<br>close(3) = 0<br>mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcb1775c000<br>
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcb1775a000<br>arch_prctl(ARCH_SET_FS, 0x7fcb1775a760) = 0<br>mprotect(0x36f118a000, 16384, PROT_READ) = 0<br>mprotect(0x3e55417000, 4096, PROT_READ) = 0<br>
mprotect(0x36f3401000, 4096, PROT_READ) = 0<br>mprotect(0x3e58406000, 4096, PROT_READ) = 0<br>mprotect(0x36f0c1f000, 4096, PROT_READ) = 0<br>munmap(0x7fcb179bf000, 42597) = 0<br>set_tid_address(0x7fcb1775aa30) = 13414<br>
set_robust_list(0x7fcb1775aa40, 0x18) = 0<br>futex(0x7fff08ace71c, FUTEX_WAKE_PRIVATE, 1) = 0<br>futex(0x7fff08ace71c, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7fcb1775a760) = -1 EAGAIN (Resource temporarily unavailable)<br>
rt_sigaction(SIGRTMIN, {0x3e55205c60, [], SA_RESTORER|SA_SIGINFO, 0x3e5520f710}, NULL, 8) = 0<br>rt_sigaction(SIGRT_1, {0x3e55205cf0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3e5520f710}, NULL, 8) = 0<br>rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0<br>
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0<br>geteuid() = 0<br>brk(0) = 0x87c000<br>brk(0x89d000) = 0x89d000<br>
open("/etc/lxc/lxc.conf", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)<br>geteuid() = 0<br>mkdir("/", 0755) = -1 EEXIST (File exists)<br>
mkdir("/run/", 0755) = -1 EEXIST (File exists)<br>mkdir("/run/lock/", 0755) = -1 EEXIST (File exists)<br>mkdir("/run/lock/lxc//", 0755) = -1 EEXIST (File exists)<br>
mkdir("/run/lock/lxc//var/", 0755) = -1 EEXIST (File exists)<br>mkdir("/run/lock/lxc//var/lib/", 0755) = -1 EEXIST (File exists)<br>mkdir("/run/lock/lxc//var/lib/lxc", 0755) = -1 EEXIST (File exists)<br>
stat("/var/lib/lxc/keymanagementservice-main/config", {st_mode=S_IFREG|0644, st_size=1507, ...}) = 0<br>open("/run/lock/lxc//var/lib/lxc/keymanagementservice-main", O_RDWR|O_CREAT, 0600) = 3<br>fcntl(3, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0<br>
access("/var/lib/lxc/keymanagementservice-main/config", R_OK) = 0<br>open("/var/lib/lxc/keymanagementservice-main/config", O_RDONLY) = 4<br>fstat(4, {st_mode=S_IFREG|0644, st_size=1507, ...}) = 0<br>mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcb179c9000<br>
read(4, "lxc.network.type = veth\nlxc.netw"..., 4096) = 1507<br>read(4, "", 4096) = 0<br>close(4) = 0<br>munmap(0x7fcb179c9000, 4096) = 0<br>
fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0<br>close(3) = 0<br>stat("/var/lib/lxc/keymanagementservice-main/partial", 0x7fff08ace420) = -1 ENOENT (No such file or directory)<br>
socket(PF_FILE, SOCK_STREAM, 0) = 3<br>connect(3, {sa_family=AF_FILE, path=@"/var/lib/lxc/keymanagementservice-main/command"}, 49) = 0<br>getuid() = 0<br>getgid() = 0<br>
sendmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16}], msg_controllen=32, {cmsg_len=28, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=13414, uid=0, gid=0}}, msg_flags=0}, 0) = 16<br>
recvmsg(3, ^C <unfinished ...><br><br></div>and there i try to kill it:<br>[root@db07 custom_workspace1]# strace -f lxc-stop -n keymanagementservice-main -k<br>execve("/usr/bin/lxc-stop", ["lxc-stop", "-n", "keymanagementservice-main", "-k"], [/* 37 vars */]) = 0<br>
brk(0) = 0xa1a000<br>mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f2ca89000<br>access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)<br>
open("/etc/ld.so.cache", O_RDONLY) = 3<br>fstat(3, {st_mode=S_IFREG|0644, st_size=42597, ...}) = 0<br>mmap(NULL, 42597, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0f2ca7e000<br>close(3) = 0<br>
open("/usr/lib64/liblxc.so.1", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\311\0\0\0\0\0\0"..., 832) = 832<br>fstat(3, {st_mode=S_IFREG|0755, st_size=1237456, ...}) = 0<br>
mmap(NULL, 2491720, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0f2c81d000<br>mprotect(0x7f0f2c87b000, 2097152, PROT_NONE) = 0<br>mmap(0x7f0f2ca7b000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5e000) = 0x7f0f2ca7b000<br>
close(3) = 0<br>open("/lib64/librt.so.1", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@! X>\0\0\0"..., 832) = 832<br>fstat(3, {st_mode=S_IFREG|0755, st_size=47064, ...}) = 0<br>
mmap(0x3e58200000, 2128816, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e58200000<br>mprotect(0x3e58207000, 2093056, PROT_NONE) = 0<br>mmap(0x3e58406000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x3e58406000<br>
close(3) = 0<br>open("/lib64/libutil.so.1", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\16 \3636\0\0\0"..., 832) = 832<br>fstat(3, {st_mode=S_IFREG|0755, st_size=17520, ...}) = 0<br>
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f2c81c000<br>mmap(0x36f3200000, 2105600, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x36f3200000<br>mprotect(0x36f3202000, 2093056, PROT_NONE) = 0<br>
mmap(0x36f3401000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x36f3401000<br>close(3) = 0<br>open("/lib64/libpthread.so.0", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340] U>\0\0\0"..., 832) = 832<br>
fstat(3, {st_mode=S_IFREG|0755, st_size=145896, ...}) = 0<br>mmap(0x3e55200000, 2212848, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e55200000<br>mprotect(0x3e55217000, 2097152, PROT_NONE) = 0<br>mmap(0x3e55417000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x3e55417000<br>
mmap(0x3e55419000, 13296, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e55419000<br>close(3) = 0<br>open("/lib64/libc.so.6", O_RDONLY) = 3<br>read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\356\341\3606\0\0\0"..., 832) = 832<br>
fstat(3, {st_mode=S_IFREG|0755, st_size=1926800, ...}) = 0<br>mmap(0x36f0e00000, 3750152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x36f0e00000<br>mprotect(0x36f0f8b000, 2093056, PROT_NONE) = 0<br>mmap(0x36f118a000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18a000) = 0x36f118a000<br>
mmap(0x36f118f000, 18696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x36f118f000<br>close(3) = 0<br>mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f2c81b000<br>
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f2c819000<br>arch_prctl(ARCH_SET_FS, 0x7f0f2c819760) = 0<br>mprotect(0x36f118a000, 16384, PROT_READ) = 0<br>mprotect(0x3e55417000, 4096, PROT_READ) = 0<br>
mprotect(0x36f3401000, 4096, PROT_READ) = 0<br>mprotect(0x3e58406000, 4096, PROT_READ) = 0<br>mprotect(0x36f0c1f000, 4096, PROT_READ) = 0<br>munmap(0x7f0f2ca7e000, 42597) = 0<br>set_tid_address(0x7f0f2c819a30) = 19909<br>
set_robust_list(0x7f0f2c819a40, 0x18) = 0<br>futex(0x7fff48064e0c, FUTEX_WAKE_PRIVATE, 1) = 0<br>futex(0x7fff48064e0c, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7f0f2c819760) = -1 EAGAIN (Resource temporarily unavailable)<br>
rt_sigaction(SIGRTMIN, {0x3e55205c60, [], SA_RESTORER|SA_SIGINFO, 0x3e5520f710}, NULL, 8) = 0<br>rt_sigaction(SIGRT_1, {0x3e55205cf0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3e5520f710}, NULL, 8) = 0<br>rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0<br>
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0<br>geteuid() = 0<br>brk(0) = 0xa1a000<br>brk(0xa3b000) = 0xa3b000<br>
open("/etc/lxc/lxc.conf", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)<br>geteuid() = 0<br>geteuid() = 0<br>access("/var", F_OK) = 0<br>
access("/var/log", F_OK) = 0<br>access("/var/log/lxc", F_OK) = 0<br>open("/var/log/lxc/keymanagementservice-main.log", O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = 3<br>
geteuid() = 0<br>mkdir("/", 0755) = -1 EEXIST (File exists)<br>mkdir("/run/", 0755) = -1 EEXIST (File exists)<br>mkdir("/run/lock/", 0755) = -1 EEXIST (File exists)<br>
mkdir("/run/lock/lxc//", 0755) = -1 EEXIST (File exists)<br>mkdir("/run/lock/lxc//var/", 0755) = -1 EEXIST (File exists)<br>mkdir("/run/lock/lxc//var/lib/", 0755) = -1 EEXIST (File exists)<br>
mkdir("/run/lock/lxc//var/lib/lxc", 0755) = -1 EEXIST (File exists)<br>stat("/var/lib/lxc/keymanagementservice-main/config", {st_mode=S_IFREG|0644, st_size=1507, ...}) = 0<br>open("/run/lock/lxc//var/lib/lxc/keymanagementservice-main", O_RDWR|O_CREAT, 0600) = 4<br>
fcntl(4, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0<br>access("/var/lib/lxc/keymanagementservice-main/config", R_OK) = 0<br>open("/var/lib/lxc/keymanagementservice-main/config", O_RDONLY) = 5<br>
fstat(5, {st_mode=S_IFREG|0644, st_size=1507, ...}) = 0<br>mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f2ca88000<br>read(5, "lxc.network.type = veth\nlxc.netw"..., 4096) = 1507<br>
read(5, "", 4096) = 0<br>close(5) = 0<br>munmap(0x7f0f2ca88000, 4096) = 0<br>fcntl(4, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0<br>
close(4) = 0<br>stat("/var/lib/lxc/keymanagementservice-main/partial", 0x7fff48064c00) = -1 ENOENT (No such file or directory)<br>socket(PF_FILE, SOCK_STREAM, 0) = 4<br>connect(4, {sa_family=AF_FILE, path=@"/var/lib/lxc/keymanagementservice-main/command"}, 49) = 0<br>
getuid() = 0<br>getgid() = 0<br>sendmsg(4, {msg_name(0)=NULL, msg_iov(1)=[{"\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16}], msg_controllen=32, {cmsg_len=28, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=19909, uid=0, gid=0}}, msg_flags=0}, 0) = 16<br>
recvmsg(4, ^C <unfinished ...><br><br></div>So, when i run from shell that gradle script - everything is fine and perfect. When i run from jenkins - I can't stop/kill, get info from containers.<br></div><div>LXC is version 1.0.0 with kernel 3.13.0<br>
</div>Any suggestions ? <br><br></div>