1

How can I get the effect of rebooting on refreshing the system (freeing resources and reinitialising them) without killing most of the things I have running?

Could I unload and reload kernel modules? Could I tell X to start fresh without killing all running programs? I'm sure I could at least stop and start some services.

My system has some kind of resource leak or other issue (see my other question) and so I have to reboot every few days. I'm hoping for a hack to make it less painful until I can solve the real problem.

3
  • 2
    Could you clarify what type of thing you want to keep? Freeing resources is essentially synonymous with stopping processes. If this is a GUI thing, does cinnamon --replace & or the equivalent for your desktop environment help?
    – terdon
    Apr 6, 2015 at 23:12
  • I want to keep windows open so I can carry on what I'm doing and don't have to reopen everything. Windows being terminal windows, text editors, firefox, vmware, etc.
    – Qgenerator
    Apr 7, 2015 at 1:49
  • When I had a problem that required reboots regularly, the most annoying thing for me was getting restored browser windows to the right workspace of the 9 I have. I developed bws to save and, after a browser restart, restore these.
    – Anthon
    Apr 7, 2015 at 13:40

2 Answers 2

1

As others have mentioned it's likely to a specific service or process, which you should be able to kill. You can start gnome-system-monitor as root to see all of the processes on the system and their CPU load.

Instead of rebooting next time try a few things:

  • Use the CTRL+ALT+F1 through F7 to switch to another terminal. This will cause your X graphics system to re-initialize some things and may solve the problem.

  • If you tried that and it doesn't work try switching to the other virtual terminal and killing your window manager with killall cinnamon then give it a second and see if the CPU load goes down and your fans stop maxing out.

  • You can also restart your window manager from another virtual terminal using:

setsid cinnamon --replace &

This command is a bit complicated so I will explain what it's doing.

  • setsid ensures that it's a top-level session and the command wont die once you close the terminal you ran this command from. If you don't use setsid you may close the terminal window or virtual terminal and then your graphics will stop working.

  • cinnamon is (probably) your window manager. Most WMs support this same --replace style, compiz, metacity, etc. This reloads your window manager and usually (as a byproduct of that) reloads your window decorator as well.

  • The trailing '&' means execute this command asynchronously or in simple terms in the background. If you don't use this the command will block the terminal you ran this from, and if you accidentally kill it (like with ^C) your graphics will fail.

0

IMO, You need to identify the service which you want to restart(use "top" command for the same).

You will have to be cautious while choosing a service to restart.

For an ex: top will also list "firefox" so you should refrain from killing it as you do not want to close it.

6
  • The system degrades to the point the active process will use 100% CPU, e.g. Firefox trying to load a youtube video. Killing Firefox doesn't help. Looking at top shows nothing.
    – Qgenerator
    Apr 7, 2015 at 13:00
  • @Qgenerator , There is no chance that top cannot show anything. You need to check column #9 for CPU usage of a process. For an example if PID of firefox is "12345' then column #9 of output of "top -p 12345" will give such information
    – shubham
    Apr 8, 2015 at 4:11
  • OK it shows the CPU use, now what?
    – Qgenerator
    Apr 14, 2015 at 22:03
  • Now you will have to kill the process that is using most of the CPU because this may be the process that is overusing CPU. Please check the process first. For killing the process use kill -9 <PID_Of_Process>
    – shubham
    Apr 15, 2015 at 8:08
  • Kill firefox, restart firefox, same problem still exists.
    – Qgenerator
    Apr 18, 2015 at 0:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .