LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-16-2015, 03:23 AM   #1
silentnightdan
LQ Newbie
 
Registered: Feb 2015
Distribution: Wheezy
Posts: 9

Rep: Reputation: Disabled
Question iceweasel boot issue


Ive tried asking on various forums - rasppi etc.

I am running a startup script to start iceweasel on bootup. it opens 2 tabs with pages for internal sites.
Only issue with the device is that it wont be rebooted correctly it has an on and off usb power supply that will kill the power.
I am wondering if there is anything that i can do or put in a startup location or a crontab that on any bootup after power cutting out that it stops the process and then restarts the process/webpages.

Any help would be appreciated
 
Old 02-16-2015, 08:08 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Welcome to LinuxQuestions.

I assume the problem is caused by not doing an orderly shutdown before turning off power.

Without doing an orderly shutdown you could corrupt the SD card. When the pi boots you can create a file and delete on shutdown. If at boot time the file already exists then restart your process.
 
Old 02-17-2015, 02:29 AM   #3
silentnightdan
LQ Newbie
 
Registered: Feb 2015
Distribution: Wheezy
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
I assume the problem is caused by not doing an orderly shutdown before turning off power.

Without doing an orderly shutdown you could corrupt the SD card. When the pi boots you can create a file and delete on shutdown. If at boot time the file already exists then restart your process.
The issue i have is the environment the pi will be used in the people dont know how to use computers at all and they speak very little English. So i have an in-line power usb which powers it as if i had to get them to shut anything down it would require a mouse which they dont have as they use a scanner + keyboard combo.
I know turning them off like this can cause corruption on the cards but the cards are still cheaper than our current system which is about 10x the price of a pi itself. What sort of file would i put in the boot up? ive tried crontabs to try and find the process used by iceweasel then kill it before booting. but that hasn't seemed to work.
 
Old 02-17-2015, 05:59 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
A better method might be to use CTRL-ALT-DEL keys
In the /etc/inittab file you should have something like:

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

If you change the -r to -h it will shutdown the PI when CTRL-ALT-DEL keys are pressed.
 
1 members found this post helpful.
Old 02-17-2015, 06:17 AM   #5
silentnightdan
LQ Newbie
 
Registered: Feb 2015
Distribution: Wheezy
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
A better method might be to use CTRL-ALT-DEL keys
In the /etc/inittab file you should have something like:

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

If you change the -r to -h it will shutdown the PI when CTRL-ALT-DEL keys are pressed.

ill have a go at that, and see if it works. The only bit in startup in the /etc/init.d i have is @iceweasel--noerrdialogs --kiosk http://www.page-to.display

obviously i change the url but i will check it out and let you know if you it works or not
only issue is people will rather turn it off and back on than press buttons. ive tried to get them to do things before but i just want to try and get all angles covered
 
Old 02-17-2015, 07:28 AM   #6
silentnightdan
LQ Newbie
 
Registered: Feb 2015
Distribution: Wheezy
Posts: 9

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by michaelk View Post
A better method might be to use CTRL-ALT-DEL keys
In the /etc/inittab file you should have something like:

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

If you change the -r to -h it will shutdown the PI when CTRL-ALT-DEL keys are pressed.

i have tried pressing those keys with the file changed, so it now looks like
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now but the pi is still online and doesnt turn off? any ideas?
 
Old 02-17-2015, 07:41 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
You did press Ctrl-alt-del at the same time?
 
Old 02-17-2015, 07:53 AM   #8
silentnightdan
LQ Newbie
 
Registered: Feb 2015
Distribution: Wheezy
Posts: 9

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by michaelk View Post
You did press Ctrl-alt-del at the same time?
yeah ive tried with ctrl alt del on 2 keyboards

tried it with ctrl altgr del also just incase it was having a funny. but neither worked on 2 different keyboards.
 
Old 02-17-2015, 08:40 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Don't remember if you have to reboot for changes to take affect. I don't have a PI and so do not what happens when you just pull power. What happens i.e. does it do a file system check and then boots normally etc.

Checking to see if a file exists using rc.local and if it does reboots the PI if not create it (i.e touch myfile). You also need to add a script to delete that file with an orderly shutdown.
 
Old 02-17-2015, 08:54 AM   #10
silentnightdan
LQ Newbie
 
Registered: Feb 2015
Distribution: Wheezy
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Don't remember if you have to reboot for changes to take affect. I don't have a PI and so do not what happens when you just pull power. What happens i.e. does it do a file system check and then boots normally etc.

Checking to see if a file exists using rc.local and if it does reboots the PI if not create it (i.e touch myfile). You also need to add a script to delete that file with an orderly shutdown.

I have rebooted a few times using sudo to make sure a proper reboot has been done. On boot it goes through the following folders

/boot/cmdline.txt
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait q$wait quiet logo.nologo

Next thing ive set up is /etx/xdg/lxsession/LXDE/autostart

@xset s off
@xset -dpms
@xset s noblank

@iceweasel --noerrdialogs --kiosk telnet://bard bed/prod/cpm_mat.asp

only bits ive modified is to make it so i have custom images on bootup and no background, just a blank window
 
Old 02-18-2015, 05:39 AM   #11
silentnightdan
LQ Newbie
 
Registered: Feb 2015
Distribution: Wheezy
Posts: 9

Original Poster
Rep: Reputation: Disabled
Anyone got any ideas? sort of at a standstill with this at the moment :/
 
Old 02-18-2015, 04:01 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
It would be nice to know what is causing the PI to not boot correctly. What steps are failing during the boot process? That might give us a better idea about what to do. Since no one else with a Pi has chimed in I'm assuming that rebooting again will fix the problem.

Add the following lines to the rc.local file.
Quote:
if [ -f /pf_test ]; then
# File exists reset
shutdown -r now
else
# create empty file and continue
touch /pf_test
fi
Quote:
#!/bin/bash
# /etc/init.d/norm_shutdown

### BEGIN INIT INFO
# Provides: normal shutdown
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 0 6
# Default-Stop:
# Short-Description:
# Description: This service is used to manage non orderly shutdown
### END INIT INFO


case "$1" in
start)
rm /pf_test
;;
stop)
;;
*)
echo "Usage: /etc/init.d/norm_shutdown start|stop"
exit 1
;;
esac

exit 0
To make the script executable
sudo chmod +x /etc/init.d/norm_shutdown

To make the script run at shutdown or reboot.
sudo update-rc.d /etc/init.d/servod defaults

This is untested.
 
1 members found this post helpful.
Old 02-20-2015, 04:38 AM   #13
silentnightdan
LQ Newbie
 
Registered: Feb 2015
Distribution: Wheezy
Posts: 9

Original Poster
Rep: Reputation: Disabled
Cool

Quote:
Originally Posted by michaelk View Post
It would be nice to know what is causing the PI to not boot correctly. What steps are failing during the boot process? That might give us a better idea about what to do. Since no one else with a Pi has chimed in I'm assuming that rebooting again will fix the problem.

Add the following lines to the rc.local file.




To make the script executable
sudo chmod +x /etc/init.d/norm_shutdown

To make the script run at shutdown or reboot.
sudo update-rc.d /etc/init.d/servod defaults

This is untested.
I had a thought yesterday of removing iceweasel again, reinstalling it but then going into the options by doing about:config and then whilst i was in there i was looking at different things and i was running through most of them rebooting and testing again until i found one section of the site which said sessionrestore from crash - which was set to true i changed that to false and a few others and now i dont seem to have the issue anymore, ive wrote the script anyway and ive stored it on my pi so if it comes back ill go down that route and ill see about running that in the startup boot file.

Thank you for your help so far!
 
  


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
Flashplayer issue on Debian Stable Iceweasel browser rng General 3 01-27-2015 02:38 PM
[SOLVED] Iceweasel/Google permissions issue Phiebie Debian 3 01-09-2013 11:21 AM
display issue of fonts with iceweasel and claws mark_alfred Debian 4 03-15-2010 02:24 PM
Iceweasel remote display issue macombej Linux - Software 0 01-07-2009 04:36 AM
iceweasel update issue kristof_v Debian 4 03-01-2007 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:40 AM.

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