Why may any user leave background processes running at will?

Hi all,
yesterday, I encountered a rather strange problem with linux in common, at least
I think so.
In my .xinitrc, I'm starting offlineimap - a console-based mail synchronization
tool - in the background. Being naive, I expected it to be killed along with the
gui applications started in that file. Yet, that assumption proved wrong and I
started asking for help on how to kill that process on #archlinux.
The guys there (again, thanks for your help and patience!) all came up with
plenty of ideas on how to avoid starting more than once instance of the program,
but that wasn't really what I was looking for. The only usable option came from
anrxc, who suggested killing the program from awesome's logout hooks.
Not fully satisfied with the solutions, I started thinking and came up with the
following question:
Why is every user allowed to leave background processes on the machine
just as he pleases, even if he logs out?
I even tried this over ssh, where the launched commands have some sort of
"parent" process, but even in this circumstance it was possbible to leave
background processes behind after logging out.
I mean, on my desktop system, this is not a big issue... I shut it down once
every day at the least and there are no users on it besides my girlfriend and
me. But this seems like a fundamental problem to me. Why is this allowed at all?
Does it make sense to do it that way? What are the consequences?
Let's discuss!

JohannesSM64 wrote:Really, you need to find a better way to manage offlineimap than starting it in xinitrc. Automatically killing any background processes on any logout will not make linux better.
Hmm... to me, .xinitrc is the place to start apps which should live just as long
as the graphical user login lasts. On #archlinux, several other places were
discussed, but none of them were "the thing":
.bashrc
Doesn't work, because a) the process would only get started when I open a shell,
not when I log in and b) because finding a place to stop the process would be
even harder.
.bash-profile
Only gets executed for a login shell, which I wouldn't account for a graphical
login at all.
wm startup script (in this case awesome's rc.lua)
Possbile, but not much better. Would fork the process all the same, merely
moving the problem. If X got killed, not even awesome's logout hooks would
apply.
Also, this approach isn't wm-agnostic, so trying out / switching to another wm
would have the problem occur all over again.
So what do you suggest? Do you have a good idea?
pseudonomous wrote:
As to the question of "why" things act this way:
I believe this is linux display it's heritage as a mulit-user operating system that people used terminals to log into to run program on.  A big place where unix used to be (and is, to some degree, still used) was in universities where a professor or graduate student might have logged onto the system to run some program to process some large set of data.  You wouldn't want to sit around and wait for this program to finish; you'd want to run it in the background, leave, and come back and look at the results a week later, when the program finished running.  One of my friends doing applied math research still does this sort of thing.  I'd imagine it's relatively common.
Process management was largely handled be systems administrators, and commonly you were being billed for CPU time, so it was in your interest not to leave programs that you didn't want to run running when you logged out.
Hmmm... that seems like a rational explanation. But in the case that is the
reason for linux' behavior: Why isn't there some kind of a mode setting? Like
one which allows any user to keep processes alive and another one that doesn't?

Similar Messages

  • How do run any vi as background process

    Hi,
    Thanks for your replies to my earlier queries. I have completed the VI project for UPS. Now I want to make this VI to run in background process, means we have to give a one installable file to the user, when he/she installed this file, the VI has to run as background process and it has to start whenever PC boots up. And also VI icon for displaying front panel has to go to system tray (where time is displayed). Can you please let me know how to do this.
    Regards
    Shivakumar Singh

    I just did a quick search on the knowledge base and found a couple of examples for you wanted to do. I would suggest doing a quick search on there.
    Knowledge Base Example
    Knowledge Base
    Joe.
    "NOTHING IS EVER EASY"

  • Why are there two ns-httpd processes running for one instance of iws 6

    Hi all,
    I'm used to iWS 4.x where there's only one watchdog and one ns-httpd process running for any given install of iWS. Now in iWS 6.x I noticed there are two processes for the admin server and two processes for the actual single web server instance, along with two watchdogs.
    What are the extra web server instances doing? I noticed that there is a 'parent' relationship with the pid's, so I guess one is spawning the other, but why? If it's to have persistent state over restart, isn't that what uxwdog is for?
    Thanks in advance,
    James Huang

    goldeye wrote:
    $ ps -ef|grep ns-httpd
    root 5612 5611 0 May 09 ? 2:22 ns-httpd -d /u00/iplanet/server6/https-admserv/config
    root 5613 5612 0 May 09 ? 5:30 ns-httpd -d /u00/iplanet/server6/https-admserv/configThis is Administration Server
    root 22940 22939 3 May 16 ? 155:11 ns-httpd -d /u00/iplanet/server6/https-eagnmnsu24f.xxxx.gov/config
    nobody 23040 22940 0 May 16 ? 136:35 ns-httpd -d /u00/iplanet/server6/https-eagnmnsu24f.xxxx.gov/configThis is Web Server instance.
    Can you send the output of ps -ef|grep iplanet ?
    iplanet Web Server is very old please move to latest Web Servers.
    You can download latest Web Servers from [http://www.sun.com/download/index.jsp?cat=Web%20%26%20Proxy%20Servers&tab=3&subcat=Web%20Servers].
    Please use either of the two
    Sun Java System Web Server 7.0 update 5 (release notes are located @ [http://wikis.sun.com/display/WebServerdocs/Release+Notes]) or
    Sun ONE web Server 6.1 SP11 ( release notes are located @ [http://docs.sun.com/app/docs/doc/820-7659]).
    Migration Guide will help you in migration [http://wikis.sun.com/display/WebServerdocs/Installation+and+Migration+Guide] or let us know if you have any problems.
    When I start Sun Java System Web Server 7.0 or Sun ONE 6.1 Server instance, I can see one watchdog and two webservd processes :
    $ps -ef|grep /export2
    user  7967  7966 ...  webservd -r /export2/ws -d /export2/ws/https-....
    user  7966  7965 ... webservd -r /export2/ws -d /export2/ws/https-...
    user  7965  1 ... ./webservd-wdog -r /export2/ws -d /export2/ws/https-...

  • Any difference setting background MRP run in MDBT and SM37

    Hello,
    Just wander if there is any differences setting up MRP run in MDBT or in SM37 to run RMMRP000?  This is to run MRP at plant level in background.
    Thanks,
    Lin-Lin

    Hi,.
    Both MDBT & SM37 are having same program (SAPLBTCH) . MDBT is <b>Foreground</b> job as well as <b>Background job.</b>
    SM37 is only for <b>Background job</b> only.
    Pls let me know any further clarification.
    regards,
    Mohan
    Message was edited by:
            Mohan Ramalingam

  • Firefox stops playing sound, closing Firefox leaves straggling processes running, kill those and sound returns, how to fix?

    Firefox 3.6.8 just now on Ubuntu 9.10, but happens on 8.04-10.04 Ubuntu with related older Firefox versions.
    Problem is probably related to Youtube/Flash problems, but something gets stuck in Firefox. I can close the main instance of Firefox, but looking in 'top' I can still find processes running for Firefox (sometimes if I try to restart Firefox I will get a note that Firefox is already running). If I kill those 'runaway processes' then restart Firefox I have Youtube/etc sound back.
    When this happens all programs on the computer cannot produce sound. When processes killed then sound works all around.

    I was able to fix this problem on my computer in Windows 7. Try going to start/control panel/programs and then uninstall the flash plugin -
    then start browser again go to a flash video and when prompted install plugin again.
    This worked well for me let me know how everyone else makes out.

  • Why are there so many inactive processes running on my computer?, etc.

    Hi,
    This issue might already be addressed but my MacBook Pro has been really slow lately and when I checked the activity monitor, the inactive processes take up half of the system memory. Usually, how much space is this supposed to take? I only have the basics plus Sophos running. I've been trying to check to see what's running but sometimes some disappear and appear momentarily. In general, what's the idea or normal composition of system memory? Any help would be much appreciated.
    Usually, this affects Safari which is slow when I switch between tabs, etc. Now, the browser has been quitting more frequently with the Java 10.4-.5 message appearing. What should I do to remedy that problem?
    Many thanks for any input!

    It is normal for there to be quite a number of inactive processes.
    the inactive processes take up half of the system memory
    There is some confusion in what you are asking. Are you talking about inactive memory? Inactive processes will not be using any CPU, but they may have inactive memory allotted to them. This is memory that, should another process require it, can be reallocated to that other process. It's like a kind of caching: it can quickly be drawn upon should the inactive process become active again and need it. In the meantime, it is free for any process to use. It is not being wasted or used.
    Usually, how much space is this supposed to take?
    You are introducing the word "space" here. I'm not sure what you mean by that, but I don't think it's applicable.
    I've been trying to check to see what's running but sometimes some disappear and appear momentarily.
    That is normal for Activity Monitor. I think you need to have a better understanding of Activity Monitor.
    http://oreilly.com/pub/a/mac/2005/10/04/activity-monitor.html
    Sophos may be slowing down your computer. You should turn off its always-on scanning feature (or whatever it's called) and just run it on demand.

  • Why are there 26 firefox.exe processes running when the taskbar shows none?

    Win 7 professional, Firefox 25.0.1. If I shut down Firefox and restart it I often get an error that a copy is already running. Checking the Task Manager shows many firefox.exe processes (26 this morning) even though the application tab shows none.

    Hello Axis,
    Can you please confirm if this happens each time you are using Firefox? Also, the cache size wouldn't have a big bearing on this issue happening. Can you please try if this issue happens when you are running Firefox in safe-mode (instructions below). if it doesn't then we can narrow the issue to a plugin / addon.
    <hr>
    Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    <hr>
    Thank you.

  • How to run background process with web application

    Hi,
    I have a web application , a servlet. I would like to have a background process that collecting data for my servlet.
    How can I achieve this? can someone point me to a tutorial or example?
    Also, would it be possible to share an object between the background process and myservlet?
    Thanks,

    Thanks for the idea.
    I had the background process running. :)
    But I'm still do not understand this part to share an object such as Java Map (<id,myobject>), what do you mean by "task a property of my ServletContextListener" ?
    BalusC wrote:
    If you make the task a property of your ServletContextListener implementation and put the implementation in the application scope, then you can access it from any servlet.Do you mind explain to me a bit more I'm still fairly new with this or maybe if you know an example.
    Here's my code snippet so far. How can I share myList to MyServlet?
    public class MonitorTimer extends TimerTask
           private Map<String, Channel> myList;
         @Override
         public void run()
              System.out.println("Monitor Timer times up");
              //Clear the map before fill with the new data
              if(myList!= null)
                   myList.clear();
              loadConfig();
            private void getData()
               //fill myList with data
    public class MyContextListener implements ServletContextListener
         @Override
         public void contextDestroyed(ServletContextEvent arg0)
              // TODO Auto-generated method stub
         @Override
         public void contextInitialized(ServletContextEvent arg0)
              System.out.println("Context Initialized");
              Timer timer = new Timer();
              //Run MonitorTimer every 2 minutes
              timer.scheduleAtFixedRate(new MonitorTimer(), 10*1000,2*60*1000);
    public class MyServlet extends HttpServlet implements Servlet
         @Override
         public void destroy()
              // TODO Auto-generated method stub
              super.destroy();
         @Override
         protected void doGet(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException
    }Thank you so much for your help,
    Edited by: geek.shrek on Nov 4, 2009 1:50 PM

  • Background processing contract?

    1416427 - Background processing in contract not working
    can any one explain . what is this functionality of background processing contract?
    Symptom
    The background processing in contract will not work. And eventhough the processing fails, success mail is send confusing the user.
    Other terms
    SRM-EBP-CON, Contract, Background processing, BBP_CONTRACT_BACKGROUND_PROC
    can you narrate?
    miuthu

    Sometimes a business document can contain lots of items, which renders the system to perform poorly when it is running in dialog mode. The setting for background processing defines a threshold of number of items for a type of document, such as contract, to be processed in the background when "save" or "release" is pressed, so as to free up the dialog process.

  • Regarding background processing of the session

    Hi Gurus
       I have some records in my flat file.
    While i am doing uploading the file using tc, in foreground it is processing correctly and no issues.
    While in Background some of the records are not processing properly and in sm35 for those records I am getting the message :"InCorrect".
    What may be the reasons I am not getting.
    Can you please suggest me where may be the wrong exactly.
    Your suggestions are highly encouragable.
    Regards,
    kumar

    Hi Sree Ram,
    This is a very common problem faced in Mass upload of data. This mainly happens if the current transaction is dependent on the previous transaction. For e.g. transaction 2 has a dependency on sucessfull processing of transaction 1.This is due to the time taken by the transaction to update the database table.
    Put a commit statement after every transaction in your recording and this will ensure that the records are updated and you will not face any problem in background processing.
    Regards,
    Guru

  • How to make a j2me application as a  background process

    HI,
    In my project,I am connecting to the webserver(Google,Yahoo).
    I wrote one socket program for connecting to those server through 80 port.
    I am able to send the request from browser(desktop) and getting the response from the server and displaying it in the browser(desktop).
    Now i want to install this application in mobile.After installing the application in the mobile,i need to go back to the browser in the mobile.
    can anyone tell me how to do this?Is it like running a background process?
    I dont have any idea about background process in j2me?
    Thanks a lot

    Now i want to install this application in mobile.After installing the application in >the mobile,i need to go back to the browser in the mobile.
    can anyone tell me how to do this?Is it like running a background process?what does that mean ?

  • Background process data format

    Dear all,
    Kindly help that when we run any report in background processing its output format not display as per excel .
    Like Lines are overlapping
    Kindly guide.
    Regards,
    Choksi

    Hello,
      In my opinion, some specific SAP notes have to be applied. Kindly check the same.
    Regards
    Mahesh

  • Need User input pop-up in powershell when its run as a background process of an Application

    Hi,
    I have created a powershell script which requires two parameters to be passed onto it for getting executed. This script is called by an application and runs it in background (no console /  window). During this process the application is unable to complete
    the execution of the script due to the missing user inputs (no popup comes for entering parameters by even after using read-host/[system.console]::Read()). 
    The powershell.exe process can only be seen in task manager.
    Is there a way in which my script will create a pop up and ask for the parameter values?
    Thanks,
    Sushruta Banerjee

    Hi,
    I have created a powershell script which requires two parameters to be passed onto it for getting executed. This script is called by an application and runs it in background (no console /  window). During this process the application is unable to complete
    the execution of the script due to the missing user inputs (no popup comes for entering parameters by even after using read-host/[system.console]::Read()). 
    The powershell.exe process can only be seen in task manager.
    Is there a way in which my script will create a pop up and ask for the parameter values?
    Thanks,
    Sushruta Banerjee
    Note that a process that runs with hidden windows will have all of its child process windows hidden. Any popup you add to the script will behidden.  There is nothing you can do about that.  This is by design.
    ¯\_(ツ)_/¯

  • How to run a background process in a J2EE App ?

    Hi guys,
    Here is the requirement which totally stumped me.
    " The web app should have a feature like a background process or something like cron jobs.. which keeps on running in the background and at a particular time each day calls a method". User intervention is not an option.
    Now had this been a stand alone app .. I could have done this using Threads.. but i cant possibly use threads in a J2EE app. Any pointers.. how I can go about realizing this
    Thanks for your replies.
    Cheers!

    You could take the approach that SoulTech mentioned and spawn a new thread from the Servlet's init method. To have the servlet invoke this method with no intervention, you would need to set the following parameter in your servlet definition in your web.xml:
    <servlet>
      <servlet-name>MyStartupServlet</servlet-name>
      <servlet-class>com.my.company.MyStartupServlet</servlet-class>
      *<load-on-startup>1</load-on-startup>*
    </servlet>When you deploy your application, the servlet will be loaded, and its init method will be called.
    If your application is running in a servlet container, I believe you are allowed (by the specification) to spawn your own threads, but you should do so carefully. Since you're writing a scheduler and not some kind of worker threads that are messing with your database, I think you should be okay. Still, just to keep it clean you should add any clean-up logic you may need to your servlet's destroy method. I know that in an EJB container, spawning your own threads can definitely be a problem and the container makes no guarantees that they will function correctly. The J2SE Timer class could be used if you're not using EJB, but the Timer class doesn't have support for J2EE - that's at least part of what led to the introduction of the timer beans in J2EE 1.4. If you're already using EJB, especially EJB 3.0, then the timer service provides a convenient built-in mechanism to do exactly what you want.
    There are always multiple ways to solve any problem...
    Edited by: proflux on May 15, 2008 1:04 PM

  • How can I run a method as a background process?

    Hello,
    I am currently working on a report where depending on the number of items selected, the user may choose to process all the items right now or as a background process.
    How can I do that in ABAP?
    Thanks

    To run a job in the background it has to be scheduled as batch job. You would usually do that using transaction SM36. As I understand your problem you want to schedule such a job directly from your coding. You may want to have a look at function group BTCH. It overs quite a few FMs to programmatically add a batch job.
    regards
    Daniel

Maybe you are looking for