Hobby-hacking Eric

2006-03-17

ssh control master

Made one useful bit of progress in the ssh control master stuff.

Before, I was having trouble with getting the control master running and out of the way. I didn't really know how to launch stuff in the background, so I basically forked the thing and polled the control master every 3 seconds to see if it was connected or not. But that was a really fragile setup, and sometimes, if I didn't type my password fast enough, I wouldn't be able to get a connection.

Tonight I have found a much simpler way to get the CM running: I just use the -f flag to make it go to background right before running the command, that is, only after it has completed the connection. This way, I don't need wait around polling, to see if the CM is running. This is terribly embarrasing how much mysterious all this process stuff is to -- seems shameful to call myself a computer scientist and not at least have some basic notions of how operating systems work. I built a toy OS for school once, but that was a really long time ago. Anyway, it does seem to work. All I know is that the exec function is a piece of darcs-internal code that makes some FFI call to a thing called smart_wait. And I guess smart_wait is happy to return if the thing goes to background or something like that.

Anyway, I was scratching my head for a while as to why I could get darcs put to work, but not darcs get. Turns out that the -S flag to scp means something else than it does for ssh. But no fear, we can use -o ControlMaster instead. Ooh tired. Will have to save this for tomorrow. Something to look forward to. Killing this project at last.

cvs keywords

A self-described newbie posted a message on darcs-users asking if there was any CVS keyword type functionality. Not something I care very much about, but I did find it kind of useful back in the dark days of CVS. Maybe it could also be useful to have in darcs. Of course, there are reasons why this kind of thing doesn't make any sense for us -- we don't do versions -- but maybe something approximative might be good enough for everyday needs.


No comments: