Reply to topic  [ 6 posts ] 
Resource busy problems 
Author Message
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 11:36 pm
Posts: 3527
Location: Portsmouth
Reply with quote
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??

_________________
Image


Wed Mar 17, 2010 1:44 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
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


Wed Mar 17, 2010 2:26 pm
Profile WWW
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 11:36 pm
Posts: 3527
Location: Portsmouth
Reply with quote
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:

_________________
Image


Wed Mar 17, 2010 2:38 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
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


Wed Mar 17, 2010 2:40 pm
Profile WWW
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 11:36 pm
Posts: 3527
Location: Portsmouth
Reply with quote
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

_________________
Image


Wed Mar 17, 2010 2:49 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
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


Wed Mar 17, 2010 2:51 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.