lxc-attach always returns 0 as success if child process has terminated by signal for jammy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
lxc 5.0.0 has a critical issue that 'lxc-attach' always returns 0 representing of success if a process running by 'lxc-attach' has been terminated by all sort of signals. but we are expecting it is on failure.
As the following logs, although it got SIGHUP, but lxc-attach returns 0.
-------
[pid 161677] --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=0, si_uid=0} ---
[pid 161675] <... epoll_wait resumed>
[pid 161675] read(6, <unfinished ...>
[pid 161677] +++ killed by SIGHUP +++
<... read resumed>
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=161677, si_uid=0, si_status=SIGHUP, si_utime=0, si_stime=3} ---
close(3) = 0
ioctl(9, TCGETS, {B38400 opost -isig -icanon -echo ...}) = 0
ioctl(9, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = 0
ioctl(9, TCGETS, {B38400 opost isig icanon echo ...}) = 0
close(9) = 0
close(6) = 0
close(10) = 0
rt_sigprocmask(
wait4(161677, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGHUP}], 0, NULL) = 161677
exit_group(0) = ?
+++ exited with 0 +++
-------
Approach
- update the package to lxc 5.0.2 which the bug has fixed[1] already.
- manually make a patch and apply it to the current package.
I recommend to update the package to lxc 5.0.2.
[1]: https:/
summary: |
- lxc 5.0.0 couldn't catch exitcode if terminated by signal for jammy + lxc-attach always returns 0 as success if child process has terminated + by signal for jammy |
description: | updated |