Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
However I note that openoffice run in two processes: soffice and
soffice.bin. Killing soffice seems to be like kill both. On man page
I note that the default signal killall send is SIGTERM, but time ago was
explained to me that the signal that kill most certainly is SIGKILL.
Can anyone give me a *five minutes process killing lesson :-)* about
this to make me more practical with these approaches?
killall -9 kills most certainly.Example killall -9 firefox.You need to learn about process and a child process.Here's what you can do to find out how many processes are running under the same name
Code:
ps aux | grep soffice
In this example it was soffice.Then you can decide which one to kill,but as I said you need to learn about processes.Search.
I try with --signal SIGKILL (-9), and it is strange but even if
soffice was killed, soffice.bin continues, while when I launch
SIGTERM, even soffice.bin was killed.
However, from this discussion I think that the right way should be:
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
If you send TERM, soffice knows it is being killed and kills soffice.bin. SIGKILL acts instantly. The best way is SIGTERM to soffice, 1..5 second pause and your pair of sigkills. So sometimes the application will have chance to clean up temporary files...
In these days I made a lot of posts about this (I say
this because I do not want to appear too reduntant or egocentric).
Was asked to me to develop a small linux box that should run as
a kiosk, without keyboard and mouse, and that is connected via
wi-fi to an external lan, that should reproduce powerpoint slideshows
and video at loop. So I develop a small approach that use a mixture
of php/shell scripts that presents a small web administration interface
to the client that could upload what he want to reproduce on the kiosk.
When the .ppt file change, seems that there is no way to make
openoffice re-read the file, so I have to kill it and restart it.
The sleep trick is what I have done before knowing of --wait
option of killall (always read the man pages, boys, even if you
presume you know about your commands :-) ).
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
--wait doesn't solve the problem.. In your case you should only use TERM, to let SOffice terminate gracefully. Sleep trick allows you to send another signal, if subtle hints to terminate are ignored.
Is not guaranted that term kill it?
I think that was guaranted but only the time was a variable (I know that
some application can ignore it, I would like to know if could happen
that signal fails). I used to do ps aux | grep -v grep | grep soffice
in a until loop to be sure that was killed. So you think I should
launch another after a few seconds?
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
TERM can be ignored or incorrectly handled by application, so there are no guarantees. But most applications, if they receive TERM why not hung and not having unsaved changes in open files will terminate eventually. The only signals that are guaranteed to work as expected are STOP, CONT and KILL, and only KILL is relevant to your situation. The drawback is that KILL doesn't let an application to cleanup anything (TERM does - so application can catch it and fail to finish cleanup; ABRT usually leads a quicker termination).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.