Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a bog standard Debian 6.0 install here that I decided to sidegrade to the Debian Testing repositories. I did this by swapping out the references to the Squeeze repos in my sources.list to use the Testing repos instead.

After the package install and a reboot, I get the following error when attempting to su - to another user:

root@skaia:~# su joebloggs -
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

If I omit the -, this does not occur.

Note that users can become root correctly, this only seems to happen when switching from root to somebody else and using the - to get that user's environment.

Google is mostly useless here. The only things I can find are references from 2011 in regards to the sux package, which appear to have been fixed in the mean time.

This looks and smells very much like an upgrade error, fixable by tweaking the right package in the right manner. I just have no idea where to start - aside from this, my system works completely normally and as expected.

share|improve this question
Hi Mike. Have you found the problem? – Mircea Vutcovici Jul 26 '12 at 15:53

2 Answers

up vote 0 down vote accepted

I would check the ownership and permissions on /dev/pts* or for a new configuration for udev related to /dev/pts devices, that was not replaced during the upgrade process.

You can also try to find out what syscal is generating the error by running as root:

strace -f su - username 2>stderr.log
share|improve this answer
1  
Better add -f to that strace, in case su decides to run the shell as a subprocess, which seems to be common now. The syscall for setting a terminal's foreground process group is ioctl(..., TIOCSPGRP, ...) and we already know it failed with ENOTTY (Inappropriate ioctl for device) so that part of the strace won't help much. But an strace of both versions of the command (with and without -) could be compared to find out why the TIOCSPGRP fails. – Alan Curry Jul 26 '12 at 4:39
That looks like a promising lead. Looking in my /dev/pts folder, there are precisely two items, namely 0, permissions set as 600 owned by the user I logged in as, and a ptmx owned by root, with zero permissions. – Mikey T.K. Jul 26 '12 at 5:04
1  
When you get the shell prompt after the No job control message, run the command tty and it will tell you which tty you're on. Then ls -l it. – Alan Curry Jul 26 '12 at 5:41
@AlanCurry, you are right, I will add -f. Thank you! – Mircea Vutcovici Jul 26 '12 at 15:52

I ended up reinstalling. Some further digging after finding out why I had none of my TTY devices (thanks Mircea!) pointed out that I had installed some of the squeeze-updates packages in the midst of my sidegrade to debian testing (forgot to comment them out of my sources.list)

This probably would have been fixable given enough time, but since this was a new system, it was just easier to redo the install rather than sort out my packages. Thanks for the help!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.