LinuxQuestions.org
Help answer threads with 0 replies.
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 08-13-2013, 01:36 AM   #1
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Mint, Xubuntu
Posts: 245

Rep: Reputation: 24
Linux gets stuck on reboot or shutdown


Hey.

I've never debugged init scripts before, but it seems like its something I'll be doing today. I'm running a headless debian wheezy on a Cubieboard. It's an ARM board like raspberry pi. I have a serial and ssh connection to the board. The problem is that the linux fails to reboot or poweroff whenever I issue a "reboot" or "shutdown -h now" command on the serial line. The only thing I see in console after issuing a reboot s a line like this:

Quote:
INIT:
Then it stops. The serial line stops responding completely, but I can still use SSH normally. The ssh terminal prints out a line telling me that the system is going for reboot now or something along those lines. Then nothing happens. But the weird thing is that it doesn't always get stuck like this. Sometimes it will reboot just fine, and I've tested it with mulitple consecutive reboots successfully. It's just sometimes that it gets stuck.

I've scanned the running processes using "ps", and I think I've found a culprit process. There's an entry in the process list like this:

Quote:
root 2622 0.0 0.0 1364 452 ? Ss 00:39 0:00 /bin/sh /etc/init.d/rc 6
Seems like that rc script gets stuck somehow, but I have no idea where. No services get terminated, so I am guessing it happens before any scripts in /etc/rc6.d are executed. This only happens on the serial line. If I issue a reboot command over the SSH terminal then it seems to work properly. It even works after the serial line gets stuck. Only the serial line has a problem with rebooting/poweroff.



How can I figure out what's causing the problem?
Can I fix it?
 
Old 08-13-2013, 11:52 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,860

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
You may have a problem with two or more processes trying to use the serial port simultaneously. If two or more processes are trying to use the serial port simultaneously make sure that all processes call the serial port by the same device name and that they are setting and unsetting the serial port lock correctly.

------------------
Steve Stites
 
Old 08-14-2013, 12:26 AM   #3
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Mint, Xubuntu
Posts: 245

Original Poster
Rep: Reputation: 24
How can I tell which processes are accessing the serial line? On the laptop when I connect the USB to serial adapter it appears as /dev/ttyUSB0, but what's the name of the serial port on the board?

greetz!
 
Old 08-14-2013, 11:42 AM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,860

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
"How can I tell which processes are accessing the serial line?"

Lock files contain the PID of the process that has locked the device.

"what's the name of the serial port on the board?"

probably /dev/ttyS0

-------------------------
Steve Stites
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
FC18: running a command on shutdown (or reboot) before every other shutdown operation P5music Fedora 3 04-23-2013 03:56 PM
Unable to shutdown/reboot server, no shutdown process running dctw Linux - Server 5 03-31-2010 05:46 AM
[FYI] "last -f <old wtmp> -x reboot shutdown" incorrect for last reboot and shutdown catkin Linux - General 1 03-25-2010 11:52 PM
Why do I loose Linux when I shutdown or reboot ? wertaylors Linux - General 4 04-06-2007 02:52 AM
How does one shutdown and reboot linux from within a program? prometheus7817 Linux - General 2 08-27-2003 06:55 AM


All times are GMT -5. The time now is 03:05 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration