Xubuntu 16.04 ttyname failed Inappropriate ioctl for device

Asked by Chris

I have a need to launch Xubuntu as a **root** user for a stand-alone demo system.

Whether I use the auto-login feature from `lightdm`, or when logging in via "Other" > "root" when prompted, I always get the following response:

    Error found when loading /root/.profile
    mesg: ttyname failed: Inappropriate ioctl for device
    As result the session will not be configured correctly.
    You should fix the problem as soon as feasible.

[SCREENSHOT HERE](http://imgur.com/a/iW5Jt)

***After clearing the popup box above, the system performs as expected with the ROOT user.***

Here are the contents of `/etc/lightdm/lightdm.conf`:

    [Seat:*]
    autologin-guest=false
    autologin-user=root
    autologin-user-timeout=0

I have seen other similar issues online relating to Valgrind, and that the issues was solved with some of the latest updates, but this still seems to be happening on Xubuntu 16.04

https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1584488

https://superuser.com/questions/1160025/how-to-solve-ttyname-failed-inappropriate-ioctl-for-device-in-vagrant

Most forums state that this message is erroneous and should not be displayed.
Is there anyway to launch Xubuntu automatically as root while avoiding this erroneous popup?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

The OS isn't designed to run as root. Why do you need to log in as root.

By doing what you are doing, your system has nearly zero security. It's far from wise

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

The security concept of Ubuntu strongly advises against usage of the "root" account, but to use the sudo function instead.

If you still want to use root, what is the contents of /root/.profile ?

Revision history for this message
Chris (chrischarles2002) said :
#3

@actionparsnip: I totally agree and am aware of the security risk. This is to be a demonstration system for account managers with zero network access. It does need to run a custom package, deisnged by a 3rd party, that does not do well as non-root (unfortunately).

Revision history for this message
Chris (chrischarles2002) said :
#4

@Manfred Hampl: here are the contents of the /root/.profile as requested:

# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
  if [ -f ~/.bashrc ]; then
    . ~/.bashrc
  fi
fi

mesg n || true

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#5

I do not know why the "mesg n || true" line produces this error.
As a workaround you could try commenting out that line and check whether this helps without creating other problems.

In my opinion the better approach would be to create a user different from root, provide it with admin rights, and run the custom package in question with "sudo packagename" (or eventually "gksudo packagename"). To avoid the question for the password, this user-application combination could be put into the sudoers file.

Revision history for this message
Chris (chrischarles2002) said :
#6

Thanks Manfred Hampl, that solved my question.

Revision history for this message
Chris (chrischarles2002) said :
#7

Thanks so much @ Manfred !!!

Commenting out that line "mesg n || true" solved the issue!

And to all: This is not my preferred setup (login in automatically as root), but I am at the discretion of the software vendor (does not know how to run code outside of root), and a customer who wants a deliverable.

I promise to try to persuade all parties to stop this practice, for the good of the infrastructure they are trying to implement.

Again, thanks to all.