LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-21-2012, 05:17 PM   #1
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
Question most shell commands I run are sent to background


Hi all,

I got my raspberry pi and all was well until it started forking most of my commands to the background...

Code:
rpi ~ $ apt-cache search website
aiccu - SixXS Automatic IPv6 Connectivity Client Utility
akregator - RSS/Atom feed aggregator
aylet - ncurses-based player for Spectrum '.ay' music files
aylet-gtk - X-GTK2-based player for Spectrum '.ay' music files
calibre-bin - e-book converter and library management
cclive - lightweight command line video extraction tool
cmatrix - simulates the display from "The Matrix"
collectd-core - statistics collection and monitoring daemon (core system)
concordance - Harmony remote configuration tool
confluence - language for synchronous reactive hardware system design
[...]

[1]+  Stopped                 apt-cache search website

rpi ~ $ libghc-snap-core-dev - Snap: A Haskell Web Framework (Core)
libghc-snap-core-prof - Snap: A Haskell Web Framework (Core); profiling libraries
libghc-snap-server-dev - iteratee-based, epoll-enabled web server for the Snap Framework
[...]

[1]+  Done                    apt-cache search website
I replaced both .profile and .bashrc in my home directory but it did not help.

I tried using dash but got the same issue.

it seems I am/was not alone. I found at least one other person having the problem and we are both debian based...
Ubuntu Forum

I tried all that was recommended he try but as for him, nothing fixed the problem.

As expected, the error is random and not only for apt commands...
Code:
$ hyde serve --port 8083 --address 0.0.0.0
 17:46:08 hyde.engine Reading site configuration from [./site.yaml]
 17:46:10 hyde Starting webserver at [0.0.0.0]:[8083]
[...]
 17:46:17 hyde.engine Generating site to [./deploy]

[2]+  Stopped                 hyde serve --port 8083 --address 0.0.0.0
I have to kill the process each time this happens!

Does anyone have a clue on what this could be?

Thanks!

Last edited by eco; 11-22-2012 at 12:15 PM. Reason: extra info
 
Old 11-22-2012, 10:51 AM   #2
mmoreno80
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Rep: Reputation: Disabled
You could try to run those processes using strace to see why they go to background.

Description

In the simplest case strace runs the specified command until it exits. It intercepts and records the system calls which are called by a process and the signals which are received by a process. The name of each system call, its arguments and its return value are printed on standard error or to the file specified with the -o option.
 
1 members found this post helpful.
Old 11-22-2012, 12:11 PM   #3
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Original Poster
Rep: Reputation: 48
Hi mmoreno80,

That was very helpful! I did a little debugging and found out that I had setup a little bash script that limited processes to use a maximum of 40% of the CPU...

Fine with daemons but not with foreground processes!

So the script would execute:
Code:
cpulimit -p 1465 -l 40 -z &
which would send the whole process to the background... sigh.

Thanks for the tip
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: make ps silent (run in background) fatalerror0x00 Programming 7 11-07-2012 10:20 AM
LXer: How to run commands in the background LXer Syndicated Linux News 0 10-10-2010 10:30 AM
scripting, perl or bash; run a background process, get pid 2ck Programming 6 04-02-2010 12:16 AM
How to run a bash command in the background from perl script professorfrink Programming 3 11-13-2003 03:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration