Skip to main content

Posts

Showing posts with the label tty

How to unfreeze after accidentally pressing Ctrl-S in a terminal?

This feature is called Software Flow Control (XON/XOFF flow control) When one end of the data link (in this case the terminal emulator) can’t receive any more data (because the buffer is full or nearing full or the user sends  C-s ) it will send an “XOFF” to tell the sending end of the data link to pause until the “XON” signal is received. What is happening under the hood is the “XOFF” is telling the TTY driver in the kernel to put the process that is sending data into a sleep state (like pausing a movie) until the TTY driver is sent an “XON” to tell the kernel to resume the process as if it were never stopped in the first place. C-s  enables terminal scroll lock. Which prevents your terminal from scrolling (By sending an “XOFF” signal to pause the output of the software). C-q  disables the scroll lock. Resuming terminal scrolling (By sending an “XON” signal to resume the output of the software). This feature is legacy (back from the 80’s when terminals were v...

Change to jenkins user

Look at the shell specified in /etc/passwd for the jenkins user. You can do so by running something like: grep jenkins /etc/passwd The output will look similar to this: jenking:1001:1001::/usr/local/jenkins:/bin/false The last field is the login shell of the user. Here you can see it is set to /bin/false which will immediately exit. The solution is to specify which shell to use as you described: su -s /bin/bash jenkins Or modify the login shell of the jenkins user with “usermod(8)” (executed as a root user) : usermod -s /bin/bash jenkins Then  grep jenkins /etc/passwd  should now output something like: jenkins:1001:1001::/usr/local/jenkins:/bin/bash After which.  su - jenkins  will work as you expect.

Change to jenkins user

Look at the shell specified in /etc/passwd for the jenkins user. You can do so by running something like: grep jenkins /etc/passwd The output will look similar to this: jenking:1001:1001::/usr/local/jenkins:/bin/false The last field is the login shell of the user. Here you can see it is set to /bin/false which will immediately exit. The solution is to specify which shell to use as you described: su -s /bin/bash jenkins Or modify the login shell of the jenkins user with "usermod(8)" (executed as a root user) : usermod -s /bin/bash jenkins Then  grep jenkins /etc/passwd  should now output something like: jenkins:1001:1001::/usr/local/jenkins:/bin/bash After which.  su - jenkins  will work as you expect.

How to unfreeze after accidentally pressing Ctrl-S in a terminal?

This feature is called Software Flow Control (XON/XOFF flow control) When one end of the data link (in this case the terminal emulator) can't receive any more data (because the buffer is full or nearing full or the user sends  C-s ) it will send an "XOFF" to tell the sending end of the data link to pause until the "XON" signal is received. What is happening under the hood is the "XOFF" is telling the TTY driver in the kernel to put the process that is sending data into a sleep state (like pausing a movie) until the TTY driver is sent an "XON" to tell the kernel to resume the process as if it were never stopped in the first place. C-s  enables terminal scroll lock. Which prevents your terminal from scrolling (By sending an "XOFF" signal to pause the output of the software). C-q  disables the scroll lock. Resuming terminal scrolling (By sending an "XON" signal to resume the output of the software). This feature is legacy (ba...