I have an Ubuntu box which I can access remotely via SSH. It is primarily a server but has a GUI with Firefox running on it for people on site to access the web interface that the server provides.
Firefox, being Firefox, sucks up memory the longer it's running.
So I'd like a way to force it to restart via my SSH connection, and assuming I'm happy with the results probably via a cron-job every night.
I can obviously "kill" it, but I'm not sure how I then restart it given that I'm not running from within the GUI environment myself; also, I don't want it to start up offering to restore tabs from a crashed session, I just want it to go to it's configured home page.
Suggestions?
Check out this link for command line start options - http://kb.mozillazine.org/Command_line_arguments#For_Linux_and_Mac_OS_X_user...
hth, Veesa
On 23 September 2011 15:41, Mark Rogers mark@quarella.co.uk wrote:
I have an Ubuntu box which I can access remotely via SSH. It is primarily a server but has a GUI with Firefox running on it for people on site to access the web interface that the server provides.
Firefox, being Firefox, sucks up memory the longer it's running.
So I'd like a way to force it to restart via my SSH connection, and assuming I'm happy with the results probably via a cron-job every night.
I can obviously "kill" it, but I'm not sure how I then restart it given that I'm not running from within the GUI environment myself; also, I don't want it to start up offering to restore tabs from a crashed session, I just want it to go to it's configured home page.
Suggestions?
-- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On 23/09/11 15:53, Jude Lucien wrote:
Check out this link for command line start options - http://kb.mozillazine.org/Command_line_arguments#For_Linux_and_Mac_OS_X_user...
Unfortunately, as far as I can tell anyway, none of these provide a means to restart Firefox or to bypass the session restore options.
On 23-Sep-11 14:41:45, Mark Rogers wrote:
I have an Ubuntu box which I can access remotely via SSH. It is primarily a server but has a GUI with Firefox running on it for people on site to access the web interface that the server provides.
Firefox, being Firefox, sucks up memory the longer it's running.
So I'd like a way to force it to restart via my SSH connection, and assuming I'm happy with the results probably via a cron-job every night.
I can obviously "kill" it, but I'm not sure how I then restart it given that I'm not running from within the GUI environment myself; also, I don't want it to start up offering to restore tabs from a crashed session, I just want it to go to it's configured home page.
Suggestions?
-- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450
To start up firefox (not already running) from a remote connection. it should be enough to execute
firefox &
This, however, will cause the firefox window to open in the remote machine (assuming it is X-enabled, e.g. you logged in from it using "ssh -X").
You should be able to cause the display to appear on the machine it is running on using the "--display=" option.
Not sure how to handle the need to re-start without the old tabs from a crashed session. 'man firefox' may offer some clues under the "profile"-related options.
Does this help? Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) ted.harding@wlandres.net Fax-to-email: +44 (0)870 094 0861 Date: 23-Sep-11 Time: 16:03:27 ------------------------------ XFMail ------------------------------
On 23/09/11 16:03, (Ted Harding) wrote:
You should be able to cause the display to appear on the machine it is running on using the "--display=" option.
I have confirmed that: firefox --display=:0.0 gets Firefox started, but assuming I first killed it, it brings up the tab restore option.
Presumably this is stored somewhere in the profile and I could delete it from the profile before restarting, if I can find out where it is.
On 23/09/11 16:12, Mark Rogers wrote:
Presumably this is stored somewhere in the profile and I could delete it from the profile before restarting, if I can find out where it is.
Well it appears that the key is ~/.mozilla/firefox/<profile>/sessionstore.js - if I kill Firefox, then delete this, then start Firefox, it starts "clean". So something like: #!/bin/bash killall -r firefox* find ~/.mozilla/firefox -name sessionstore.js -delete firefox --display=:0.0 &
Thanks for your help. There seemed to be more people asking for this without solutions on my Google searches suggesting it was going to be harder than this! Hopefully this will help someone via the archives!
On 23/09/11 16:24, Mark Rogers wrote:
Well it appears that the key is ~/.mozilla/firefox/<profile>/sessionstore.js
- if I kill Firefox, then delete this, then start Firefox, it starts
"clean". So something like: #!/bin/bash killall -r firefox* find ~/.mozilla/firefox -name sessionstore.js -delete firefox --display=:0.0 &
A couple of notes to add to this: - On my actual server, display is :0 not :0.0 - is there any difference? - The GUI user in my case isn't the same as the user I SSH in with, so to run this I needed: sudo -Hu user ./ffrestart.sh .. where "user" was the user running Firefox; -H is needed so that ~ expands correctly to the user's home directory in the script.