Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools Console Foundations Processes Pausing and Resuming

Using '&' in Console

I am running the latest version of Ubuntu.

When I try running

'top &'

and then type

'jobs'

it comes back fine.

If I try, however, to type

'fg'

It says: "top

top: failed tty set: Interrupted system call"

If I try again to type 'jobs'

there are no jobs running.

Nathan Tallack
Nathan Tallack
22,159 Points

Can you try something for me?

From your console enter a root shell. Do this with the following command.

sudo su -

This will prompt you for your user password.

Once in your root shell try to do the same thing with suspending and resuming top. Tell me if you get the same interrupted system call message.

Once done exit your root shell with the exit command. Please do TAKE GREAT CARE when in the root shell as you can easily break things so do exit it when done.

Hi Nathan,

I tried that and I actually get the same issue / return prompt.

Any thoughts? I am not sure what is going on.

Thanks

Nathan Tallack
Nathan Tallack
22,159 Points

Actually that is quite confusing. I am surprised you get the same result elevated to root.

Can you verify you are running your shell using the OS X Terminal app and not via some other application? You can verify this by clicking on your spotlight icon (magnifying glass in the top right of your screen) and typing Terminal and clicking on the first result.

If you are indeed running it in the OS X Terminal app then I am very very interested and would love to hear that conformation because you should not have any trouble backgrounding top within that app as the root user and it may indicate that something is legitimately (a security app?) or illegitimately (a trojan? or virus?) killing processes.

Please let me know. :)

Hi Nathan,

I am actually running Ubuntu, not OS X.

If I try

'sudo top &'

'jobs'

'fg'

type in my password, it will work. Otherwise it won't.

I am using Ubuntu's terminal.

Any thoughts?

2 Answers

You said that you use the newest ubuntu dist. Do you mean the newest stable "LTS" version (v. 14.04) or the newest version without "LTS" (v. 15.10) ? Because the 15.10 COULD MAYBE be the reason that it acts weird because it still is "kinda" under development. I really really doubt that it has something to do with it BUT you never know...

Or did you find the problem? If yes, what was ist? Because I'm just getting started on the Console foundation course, and I am too using ubuntu. The LTS version 14.04 (desktop).

On Ubuntu 16.04. It's the same issue here - we can only fg if we start/pause using 'sudo.'

And, this is only an issue if we use '&' to pause the job immediately.

Oh well, relatively small quirk - I don't see this causing any major issues any time soon!

@Nathan Tallback

I had the same issue, but it worked with your solution. I am running an Ubuntu within the Windows subsystem.

I was just wondering if you could tell me why it works when you are logged in as the root and not as a user.

Thanks in advance!

Gabe