LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-31-2007, 03:34 PM   #1
Winter Knight
Member
 
Registered: Nov 2005
Distribution: Debian Stable/Testing
Posts: 54

Rep: Reputation: 15
How to simulate closing a window from the command line with /usr/bin/killall?


When I shutdown my computer with /sbin/shutdown, the computer shuts down. However, if I had any firefox windows open when I shutdown, then when I restart firefox, I get the "Firefox was not properly shutdown" message.

I am working on a shutdown script to close firefox before calling shutdown. I have tried killall -s $x firefox, where $x is HUP, INT, QUIT, and a few others, but firefox is shutdown improperly every time.

How can I simulate clicking on the "X" in the window's corner within a script?
 
Old 11-01-2007, 10:47 AM   #2
bjagee
Member
 
Registered: Jan 2007
Location: Portland, OR
Distribution: Ubuntu Jaunty / Fedora
Posts: 39

Rep: Reputation: 15
Did you try TERM?
 
Old 11-09-2007, 03:44 AM   #3
somethingfoo
LQ Newbie
 
Registered: May 2006
Posts: 8

Rep: Reputation: 0
I have a similar shutdown script that I use, and if I recall correctly, I use wmctrl to send a 'close' message (not quite sure though - I'm currently at work so I'll have to check when I get home).
 
Old 11-10-2007, 04:09 AM   #4
KrahnacK
Member
 
Registered: Nov 2007
Location: /dev/volcano
Posts: 70

Rep: Reputation: 15
it is as somethingfoo said : the only way to quit properly a graphical application is by using a window manager message (to simulate click on the "X" in the window corner), i'm not familiar with it so i'll let someone else explain how to do

this is true for graphical applications, otherwise, in order to kill processes on a shutdown, the signal which seems appropriated is HUP (means ancestors of the process are quitting, process needs to quit, to avoid zombies)

if i remember well, when in the good runlevel, the INIT process sends to all remaining processes a TERM, then a KILL signal, so there wouldn't be a need to send theses signals before... unless you really need to have a process killed to do job with its results
 
Old 11-10-2007, 04:19 AM   #5
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
hi.

one option is to turn off this firefox feature. its called "resume from crash".

in firefox address bar type:

about:config

and you will see a list, lots, of options.

goto "browser.sessionstore.resume_from_crash" double click it and the value turns from true to false.

now try !!

p.s. lots of "hidden" features can be played with here
 
Old 11-10-2007, 04:05 PM   #6
Winter Knight
Member
 
Registered: Nov 2005
Distribution: Debian Stable/Testing
Posts: 54

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bjagee
Did you try TERM?
Yes. That is the default signal for killall. I also tried explicitly specifying it, as well as others. I should have mentioned TERM in the list of signals I've tried. As KrahnacK said though, that one is sent automatically anyway.

Quote:
Originally Posted by somethingfoo
I have a similar shutdown script that I use, and if I recall correctly, I use wmctrl to send a 'close' message (not quite sure though - I'm currently at work so I'll have to check when I get home).
Thanks. I suspected that the close button did more than just send a signal. I'll look into using wmctrl if I have this problem in the future.

Quote:
Originally Posted by keratos View Post
one option is to turn off this firefox feature. its called "resume from crash".
Thanks. That's the best solution for me. I never used that feature anyway. Unless I experience any problems, I'll keep this feature disabled.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/usr/local/apache2/bin/apachectl: line 65: 4407 Segmentation fault $HTTPD -k $A onlin85 Linux - Software 2 06-18-2009 06:54 AM
/usr/bin/lesspipe: line 223: syntax error: unexpected end of file fakie_flip Linux - Software 1 09-06-2006 02:22 AM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 01:02 AM
sh: line 1: /usr/bin/(swapd): No such file or directory QtCoder Linux - General 4 04-11-2005 05:33 PM
Error in man command "sh: line 1: /usr/bin/gtbl: No such file or directory" MinA Slackware 1 09-06-2004 06:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 10:19 PM.

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