[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

unlocking a serial device

Posted on 1998-02-22
8
Medium Priority
?
561 Views
Last Modified: 2012-08-13
Heya all!

Sometimes after i reboot my linux box a serial port or two
are locked for some reason.. and a file LCK..ttySx is created in /var/lock

Is there anyway to unlock this device so it's useable again ?

unlock /var/lock/LCK..ttySx doesn't work..  makes the computer THINK it's unlocked, but still doesn't work.

Is there another way I should be doing this?

Thanks
Andrew

q@qonline.com.au
0
Comment
Question by:Q010797
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 2

Expert Comment

by:bjacobs
ID: 1636271
Delete the LCK file
0
 
LVL 1

Author Comment

by:Q010797
ID: 1636272
that's the same as unlock /var/lock/{lock file}

no go.  I need some correct way of doing it
0
 

Expert Comment

by:spjuver
ID: 1636273
Which daemons are running??
Do a 'ps -ax' and post it.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Q010797
ID: 1636274
I have to wait till the problem occurs again (only ever after a reboot) and I will paste the ps -ax here . .

Have just rebooted.. if I don't have locked tty's in an hour.. I won't have them at all . . makes sense right ? :)
0
 
LVL 1

Author Comment

by:Q010797
ID: 1636275
at the moment . .ttyR7 is locked but it shouldn't be

120  ?  S    0:00 /usr/local/sbin/mgetty ttyR6 -n 1 -D -x2 -m "" ATZ OK
  121  ?  D    0:00 /usr/local/sbin/mgetty ttyR7 -n 1 -D -x2 -m "" ATZ OK
  122  ?  S    0:00 /usr/local/sbin/mgetty ttyS0 -n 1 -D -x2 -m "" ATZ OK
  123  ?  S    0:00 /usr/local/sbin/mgetty ttyS1 -n 1 -D -x2 -m "" ATZ OK
  124  ?  S    0:00 /usr/local/sbin/mgetty ttyS2 -n 1 -D -x2 -m "" ATZ OK
  125  ?  S    0:00 /usr/local/sbin/mgetty ttyS3 -n 1 -D -x2 -m "" ATZ OK

it has a D instead of an S next to it... this help anyone fix my problem?
0
 

Expert Comment

by:spjuver
ID: 1636276
The only way to get a lock-file is to start a deamon which uses that port. The problem can, with other words, be a hanging process or a process with crashed.

If it only occurs during/after a reboot check your boot scripts for such kind of daemons.
0
 
LVL 1

Author Comment

by:Q010797
ID: 1636277
Thing is... straight after the boot there will be no lock file for upto 30minutes..  and I assume it's mgetty that is hanging.  Why does it only do it sometimes? and why only after a reboot?  I don't usually have to reboot more than twice for it to go away.
0
 

Accepted Solution

by:
luteijn earned 100 total points
ID: 1636278
Perhaps rebooting somehow upsets your modems, and some of them
start to babble endlessly with the getty, after a while confusing
eachother so much that they keep at it forever...
See if anything interesting is in your syslog (getty complaining
about what is send to it by the modem for instance)
Sometimes my modem does things like this when used for dialin,
I then just killed all the stuff interacting with it: kill -9 `ps |grep S2 |grep -v grep|awk '{printf $1}' `
removed the lock file: rm /var/spool/uucp/LCK..cua2, and reset the whole thing: stty crtscts < /dev/cua2 ; printf "+++at&Y0s0=4\n\r" >/dev/cua2
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question