# reset USB<->RS232 adapter over SSH



## m4rtin (Dec 10, 2010)

I'm at home and in my office machine, there is an USB<->RS232 adapter connected to a Cisco device. There is no _screen_ running in the office machine so I can't take this session over. If I connect to my office machine over SSH and start for example _minicom_, the results are following:


```
[root@ /usr/home/martin-office]# minicom 
Device /dev/cuaU0 is locked.
[root@ /usr/home/martin-office]# file /dev/cuaU0
/dev/cuaU0: character special
[root@ /usr/home/martin-office]# ls -l /dev/cuaU0
crw-rw----  1 uucp  dialer    0, 117 Dec  9 18:47 /dev/cuaU0
[root@ /usr/home/martin-office]#
```

One possibility would be to reboot the office machine, however, are there better options? Like somehow resetting the /dev/cuaU0 device?


----------



## lme@ (Dec 10, 2010)

What about killing the process that's locking the device?
`# procstat -f -a | grep cuaU0` should show the process.


----------



## ondra_knezour (Dec 10, 2010)

Maybe watch() may help you to get access to running session?


----------



## wblock@ (Dec 10, 2010)

lme@'s suggestion is the first thing I'd try.  usbconfig(8) can reset the USB device.  Whether that will kill the program that has it locked...


----------

