Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxc-stop (v4.0.12) seems not to work #4114

Open
netITea opened this issue May 9, 2022 · 1 comment
Open

lxc-stop (v4.0.12) seems not to work #4114

netITea opened this issue May 9, 2022 · 1 comment
Assignees

Comments

@netITea
Copy link

netITea commented May 9, 2022

I try to stop my application container with "lxc-stop -k -n up" and the program just hang.
The srtace-output shows following:

5278 10:44:41.007211 connect(4, {sa_family=AF_UNIX, sun_path=@"//var/lib/lxc/up/command"}, 27) = 0
5278 10:44:41.007278 getpid() = 5278
5278 10:44:41.007386 getuid() = 0
5278 10:44:41.007508 getgid() = 0
5278 10:44:41.007595 sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", iov_len=16}], msg_iovlen=1, msg_control=[{cmsg_len=28, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, cmsg_data={pid=5278, uid=0, gid=0}}], msg_controllen=32, msg_flags=0}, MSG_NOSIGNAL) = 16
5278 10:44:41.007745 recvmsg(4, {msg_namelen=0}, MSG_CMSG_CLOEXEC) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
5278 10:44:50.634810 --- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
5278 10:44:50.635258 +++ killed by SIGINT +++

This matches the code of the function lxc_cmd() (it calls lxc_abstract_unix_send_credential()) witch try to send a STOP-command and waits for a response.
I see here two problems. The first one is that there no response-waiting-timeout, which is bad if I want to use C-API (c->stop or even c->shutdown with timeout) and it hangs.
The second one is, that I haven't seen the other side (strace-output of lxc-execute) receiving this STOP-command. May it have some relation to #4112?

@netITea
Copy link
Author

netITea commented May 10, 2022

This problem is related to #4112 indeed.
I found out that __lxc_start() does not achieves lxc_poll() because it stucks in lxc_spawn() which calls lxc_sync_barrier_child()!
And lxc_sync_barrier_child() waits for something (message or closing) on sync_sock[1].
I resume: the lxc app process is unable to receive any command via maincmd_fd.

@mihalicyn mihalicyn self-assigned this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants