x404.co.uk
http://www.x404.co.uk/forum/

Resource busy problems
http://www.x404.co.uk/forum/viewtopic.php?f=4&t=7045
Page 1 of 1

Author:  Nick [ Wed Mar 17, 2010 1:44 pm ]
Post subject:  Resource busy problems

Basically, I've got a USB/Serial adapter which I have installed the drivers for etc and use to communicate with my routers and switches.

Command to begin comms:
Code:
screen /dev/tty.PL2303-0000105D


It works a treat, and I can do everything I need to.

The problem is when I'm finished, and I attempt to run screen again it gives an error that the resource is busy.

How can I close screen in such a way that it handles this nicely, and doesn't lock the resource?

Also - is there a way to unlock the resource, other than restarting the machine??

Author:  forquare1 [ Wed Mar 17, 2010 2:26 pm ]
Post subject:  Re: Resource busy problems

Have you tried:
Code:
screen -D /dev/tty.PL2303-0000105D


Not sure if that works, but from the man page:
Code:
            -d|-D [pid.tty.host]
            does  not  start screen, but detaches the elsewhere running screen
            session. It has the same effect as typing "C-a  d"  from  screen's
            controlling  terminal.  -D  is  the equivalent to the power detach
            key.  If no session can be detached, this option  is  ignored.  In
            combination  with  the  -r/-R  option more powerful effects can be
            achieved

Author:  Nick [ Wed Mar 17, 2010 2:38 pm ]
Post subject:  Re: Resource busy problems

Ah okay! Thanks for that post forquare.

That doesn't solve my problem, but I've noticed in Activity Monitor that Screen is still running. When inspecting the process, I can see that it has still got the resource open.

I can't remember exactly how I closed Screen before, but I'm assuming that I must have just closed the Terminal window because it's still running!

From Activity Monitor I quit the process and now all is well. I'll have to Google how to exit Screen. :)

On the down-side, I've now run out of excuses not to crack on with my Cisco IOS studies! :lol:

Author:  forquare1 [ Wed Mar 17, 2010 2:40 pm ]
Post subject:  Re: Resource busy problems

Screen will continue running while any child process is running.

If you just close the Terminal window down or do "Ctrl-a d" within screen, then it will continue to run.
You should be able to reattach using
Code:
screen -r

Author:  Nick [ Wed Mar 17, 2010 2:49 pm ]
Post subject:  Re: Resource busy problems

Cool.

I was just quite surprised it didn't stop running when I logged out.

screen -D wanted a session name, so screen -r probably will too. I don't know what the hell that is, or how I can find it so for now I'm gunna stick to the n00by way of force quitting it from Activity Monitor! :lol:

In labs at uni I don't have such a problem because I use two screen sessions (one for each serial port) for the whole three hour lab, then shut the machine down and take the HDD home. I don't think many processes are able to remain open through that ordeal! :P

Author:  forquare1 [ Wed Mar 17, 2010 2:51 pm ]
Post subject:  Re: Resource busy problems

Screen is quite a cool tool, but it took me ages to get my head around it. I didn't know you could use it in the way you are using it.
I write a page to remind myself what I know about screen, you can find it here it it's any use:
http://hashbang0.com/?location=tutorial ... &section=7

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/