[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] SuSE and serial ports
> Hi all
>
> I am having a problem with SuSE 6.3 and serial ports, using "cu -l ttyS1" I
> get the response "port in use"
>
> trying this with ttyS0 I can talk to the modem.
>
> The system did have a mouse on ttyS1, but I have taken this out, connected
> the modem, stopped gpm, removed the /dev/mouse link, but it still won't
> work.
>
> I have also switched to single user mode and checked the init scripts to
> make sure nothing is using the port. This also dosn't work so I tried a full
> reboot to switch off anything using the port, still no luck.
>
> Any ideas please
>
Type:
lsof /dev/ttyS1
which gives an output like:
[189%][infinitum][chris] >lsof /dev/ttyS1
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
pppd.bin 32525 root 0u CHR 4,65 274106 /dev/ttyS1
[190%][infinitum][chris] >
which shows me pppd.bin has /dev/ttyS1. Does lsof report anything to be
talking to it ? Failing that, doing and "strace" is always useful as a
diagnostic if you like lots of verbosity. strace will trace the system calls,
so what you'll see will be a dump of the program's operation. Doing an
'strace cat /dev/modem' whilst online (so pppd has /dev/modem) gives me (this
is the last few lines):
brk(0x804b000) = 0x804b000
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
open("/dev/modem", O_RDONLY) = -1 EBUSY (Device or resource busy)
write(2, "cat: ", 5cat: ) = 5
write(2, "/dev/modem", 10/dev/modem) = 10
write(2, ": Device or resource busy", 25: Device or resource busy) = 25
write(2, "\n", 1
) = 1
close(1) = 0
_exit(1) = ?
So look for the 'open' which in this case reported EBUSY - this way if a
device hasn't got the modem, it could be a dot-lock file which if exists
causes cu to abort. With 'strace cu -l ttyS1' you should be able to locate
the dot-lock or the actually problem causing it to abort.
'lsof', 'fuser', and 'strace' are very useful debugging tools :) Lsof
especially ... it's *VERY* flexible and reports nearly everything that a
process has open (files, devices, unix domain sockets, network sockets...).
Chris...
--
Chris Johnson \ "If not for me then, do it for yourself. If not
sixie@nccnet.co.uk \ for then do it for the world." -- Stevie Nicks
www.nccnet.co.uk/~sixie/ ~---------------------------------------+
Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \______
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.