Visar inlägg med etikett English. Visa alla inlägg
Visar inlägg med etikett English. Visa alla inlägg

2008-09-25

Howto kill a process in linux

If you have a program that using a lot of your computers resources or not responding it can be necessary to kill it the hard way, here are some ways to do that.

  • With the kill command.
    If you know the PID (every process in your system has a uniq number, that's the PID, shortcut for Process IDentifier ) of the process, you can send it a signal with the kill command. There are several signals you can send and depending on the process it will be terminated. Some of the most common signals to end a process are SIGHUP, SIGINT, SIGTERM and SIGKILL. SIGTERM is the signal you should try first and if that don't work use SIGKILL. To send a signal to the process with the kill command type this in a console: "kill -SIGNAL PID" where you replacing SIGNAL with a signal and PID with the processes process identifier number. To find out the PID of a process you can use one of the "pidof", "pgrep", "top", or "ps" command in a console.

  • With the pkill command.
    pkill is a command similar to kill in that it will send signals to a process to terminate it, the difference to kill is that you don't need know it's PID, instead you terminate a process based on its name. If you type "pkill firefox" in a console pkill will terminate all processes with firefox in it's name. pkill will by default send a SIGTERM signal but that can be changed. WARNING! be careful as pkill will terminate ALL your processes that have what you specified in its name.

  • With the xkill command.
    In X-Windows you can kill processes that have a window with the xkill command. Running xkill will get you a mouse cursor of a death skull and if you click with it on a window it will be terminated. In KDE pressing the Ctrl+Alt+Esc keyboard shortcut will run the xkill command.

  • With KDE.
    In a default KDE setup you can press Ctrl+Esc keyboard shortcut to open a window with all processes listed and from where you can right click on one and choose a signal to send to it.
  • With SysRq.
    With the SysRq keyboard key you can make the kernel do some really powerful stuff with you system. Type "cat /proc/sys/kernel/sysrq" in a console to see if SysRq it is enabled, if the result is "1" it's enabled or else you can activate it by running one of this command as root "echo 1 > /proc/sys/kernel/sysrq" or with the sysctl command like this "sysctl -w kernel.sysrq=1". By pressing any of the keyboard shortcuts below you will tell the kernel to do what's described in the parentheses.

    Alt+SysRq+r (The r stands for put keyboard in raw mode)
    Alt+SysRq+s (The s for sync the disk)
    Alt+SysRq+e (The e for terminate all processes)
    Alt+SysRq+i (The i for kill all processes)
    Alt+SysRq+u (The u for remount all file systems read only)
    Alt+SysRq+b (The b for reboot the system)
Beware that using some of these SysRq commands it is very dangerous as it will kill all processes in your system and you will loose all data that are not saved. Use it at your own risk and only as a last option.

Good luck killing your system.

2008-04-17

Things that sucks in Kubuntu 7.10 AMD64

There are several things in Kubuntu 7.10 that I don't like and it feels like it's not mature enough to be released at all. I wounder what they were thinking when they made some of the choices.

  1. Bootsplash
    The Bootsplash screen don't work on AMD64. The screen stays black until you are presented with the login dialog. As far as I understand it, Kubunt uses VESA for displaying the bootscreen and the VESA driver in the kernel dont support AMD64. It should be mentioned somewhere in the installation or in the documentation.
  2. Firefox
    Several plugins for Firefox like Flash and Java don't work with Firefox 64-bit that is installed. Well, it's not Kubuntu developers fault, but I think there should be an option to install Firefox 32-bit because everything then would work. There are unsupported ways like nswrapperplugin and Firefox32.
  3. KMilo
    KMilo is a KDE Service that would make your keyboard multimedia keys work. Kubuntu uses KDE 3.5.8 and KMilo in that version has bugs that, for instance, won´t let you change the volyme more than between 0% - 11%.
  4. Dolphin
    Dolphin is the default file manager in Kubuntu 7.10. The version in Kubuntu is unmature, buggy, unsupported and lacks functions that all file manager should have. If you want a real file manager look at Krusader.
  5. Strigi
    Strigi is a desktop search program which will scan and index files in your home folder so that you later can search for file names or/and contents. Strigi is installed by default and would be OK if only it worked. Strigi wasn't able to finish indexing the files and I couldn't search for any information, because it just kept crashing.
  6. Amarok and Kid3
    Amarok is a music organiser and player. Kid3 is a program to add and edit the metadata in music files. Neither of the programs can show coverart that are embedded in the ID3 tag of MP3 files. The images will be displayed distordered while Easytag display them just fine. This could be a bug in Taglib or some other library used by KDE and Amarok.
  7. DLink DWL-G122 Wireless network card
    DWL-G122 is a wireless USB network card. Despite claims on the forum that it would work in Kubuntu 7.10 with default drivers, it dosen't work for me. When I insert DWL-G122, Kubuntu will load the drivers and it seems OK but I can not connect to my router. The solution for me was to download and compile the driver from serialmonkey.com. Because that worked, Kubuntu should use that driver instead.
That's just some of the bugs and annoying things i found in Kubuntu 7.10 and I'm sure i can find plenty of more. Kubuntu 8.10 Hardy will be out soon and i hope it will fix some of the things or else i think i will search for another Linux distribution.

2008-04-16

Howto make firefox work in Ubuntu AMD64 with flash and java

One of the biggest problem i had when i first installed Kubuntu 7.10 64-bit is that i couldn't run firefox with the java and flash plugins. The problem is that Adobe has no 64-bit version of flash and Sun java plugins dont work ether. There is a solution and it is to install a 32-bit firefox and the 32-bit plugins will work. So how do you do that you may ask. There is a thread on the ubuntu forum with a script that can download firefox, flash, java, install them and configure them and you don't even have to uninstall your 64-bit firefox. Go to the thread on ubuntuforums.org and click on the link "The new script will work on Dapper, Edgy, Feisty, and Gutsy" to download the script file.

If you want to know more about what the script do read through "Manual howto" section. To install Firefox and the plugins open a terminal and go to the catalog where you saved the downloaded file, unpack it and run it with the command:

tar -xvf ff32-3in1-*.tar.gz && cd ff32-3in1 && sudo ./3in1

It will ask you some question, enter you choices and when it has finished you should now have a firefox32 menu entry. Start firefox32 from the start menu and write about:plugins in the adressfield and you will be presented with a side over all plugins Firefox can use. Try to watch some videos from youtube to test that flash is working. Go to javatester.org to test that java is working.

Happy surfing

Update:
As of Kubuntu Hardy firefox and flash work "out of the box" for me after installing flashplugin-nonfree.