"CTRL+C" fails with error when command is invoked with sudo in scl environment.
Issue
- Problem with executing command
/bin/bash /var/tmp/sclXXXXXX. -
Getting error message once kill the below process by hitting
CTRL+C:$ scl enable gcc-toolset-10 -- sudo tail -f /var/log/messages Jun 1 17:40:31 xk11 kernel: nfs: Deprecated parameter 'intr' Jun 1 17:41:10 xk11 kernel: nfs: Deprecated parameter 'intr' Jun 1 17:41:30 xk11 systemd[1]: Started /usr/bin/systemctl start man-db-cache-update. Jun 1 17:41:30 xk11 systemd[1]: Starting man-db-cache-update.service... Jun 1 17:41:31 xk11 systemd[1]: man-db-cache-update.service: Succeeded. Jun 1 17:41:31 xk11 systemd[1]: Started man-db-cache-update.service. Jun 1 17:41:31 xk11 systemd[1]: run-r05b7f290fc784e3b94b5cb53b7c9b09b.service: Succeeded. Jun 1 17:50:13 xk11 systemd[1]: Starting system activity accounting tool... Jun 1 17:50:13 xk11 systemd[1]: sysstat-collect.service: Succeeded. Jun 1 17:50:13 xk11 systemd[1]: Started system activity accounting tool. ^CProblem with executing command "/bin/bash /var/tmp/sclh6qCzE" -
scl enable gcc-toolset-10 bashProcess stays on.#ps -ef | grep scl root 54119 54082 0 11:06 pts/0 00:00:00 /usr/bin/scl enable gcc-toolset-10 bash root 54120 54119 0 11:06 pts/0 00:00:00 /bin/bash /var/tmp/scluvOXF4 root 54163 54124 0 11:06 pts/0 00:00:00 grep --color=auto scl -
Issue seen only when using sudo for root and other users.
1)Exits normally
# scl enable gcc-toolset-10 bash # tail -f /var/log/messages Ctrl+C2)Throws error
# scl enable gcc-toolset-10 bash # sudo tail -f /var/log/messages Ctrl+C3)strace output
#strace -ffo strace.out scl enable gcc-toolset-10 -- sudo tail -f /var/log/messages openat(AT_FDCWD, "/var/tmp/sclaiLlVn", O_RDWR|O_CREAT|O_EXCL, 0600) = 3 fcntl(3, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE) fstat(3, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0 write(3, "eval \"SCLS=( ${X_SCLS[*]} )\"\n 't"..., 62) = 62 close(3) = 0 rt_sigaction(SIGINT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f471aed8880}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGQUIT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f471aed8880}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 clone(child_stack=NULL, flags=CLONE_PARENT_SETTID|SIGCHLD, parent_tid=[54899]) = 54899 wait4(54899, 0x7ffd1515bbe8, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) --- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} --- wait4(54899, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGINT}], 0, NULL) = 54899 rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f471aed8880}, NULL, 8) = 0 rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f471aed8880}, NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=54899, si_uid=0, si_status=SIGINT, si_utime=0, si_stime=0} --- write(2, "Problem with executing command \""..., 62) = 62
Environment
- Red Hat Enterprise Linux 8.3
- scl-utils-2.0.2-13.el8.x86_64
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.