SUSE Support

Here When You Need Us

Starting a shell from scripts using su results in "no job control in this shell"

This document (7009640) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 11 Service Pack 1
 

Situation

Starting with coreutils-6.12-32.26.1, when starting a shell from a su command, the command exits with:
 
linux:~ # su - test -c "echo 1; echo 2; bash"
1
2
bash: no job control in this shell
test@linux:~>

resulting in not being able to use bash's job control and put processes into the background with "CTRL+z bg".

Resolution

To address this, please use the option
 
--session-command

instead of
 
-c

Example:
 
linux:~ # su - test --session-command "echo 1; echo 2; bash"
1
2
test@linux:~>

Cause

coreutils-6.12-32.26.1 addressed a security issue which allowed a possible hijacking of a tty while executing su. The fix changed the behavior of the -c option and disables job control inside the called shell.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7009640
  • Creation Date: 26-Oct-2011
  • Modified Date:19-Aug-2022
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.