~ubuntu-branches/ubuntu/breezy/detachtty/breezy

« back to all changes in this revision

Viewing changes to README

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Barlow
  • Date: 2001-10-17 10:59:03 UTC
  • Revision ID: james.westby@ubuntu.com-20011017105903-bio9d99ifhas70ih
Tags: 5
* FreeBSD portability fixes
* Includes text from strerror when reporting OS errors
* Upload sponsored by Matthew Danish <mdanish@andrew.cmu.edu>

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-*- Text -*- is good.
 
2
 
 
3
                            detachtty
 
4
 
 
5
detachtty lets you run interactive programs non-interactively, and
 
6
connect to them over the network when you do need to interact with them.
 
7
 
 
8
If you've used screen, it's a similar concept.  Compared to screen,
 
9
detachtty has
 
10
 
 
11
 * no capability to swap between different screens (it doesn't co-opt C-a)
 
12
 * no tty emulation (you can sanely use it in emacs comint modes)
 
13
 * no features (less to go wrong)
 
14
 * no configuration file
 
15
 * ability to spawn ssh to securely connect across the network
 
16
 
 
17
* What it's for - a likely usage scenario
 
18
 
 
19
I have a persistent server implemented in Lisp.  Usually it sits there
 
20
serving things, but sometimes (for example when a new version is
 
21
available and it needs to be upgraded) I need to connect to it and
 
22
type Lisp at it.
 
23
 
 
24
Why don't I use screen?  I could - I used to do exactly that - but
 
25
then I have to talk directly to the CMUCL repl, which means no command
 
26
line editing.  I want to use ILISP, but (1) screen's terminal handling
 
27
is likely to confuse Emacs, (2) screen isn't network-enabled and the
 
28
server machine doesn't have Emacs installed anyway.
 
29
 
 
30
* How it works:
 
31
 
 
32
detachtty has two parts: 
 
33
 
 
34
** detachtty  - the server
 
35
 
 
36
opens a pseudoterminal and starts your program on the slave end.  It
 
37
then copies between that tty and a unix-domain socket whose location
 
38
you specify when you start it
 
39
 
 
40
detachtty has options to fork into the background, to specify the
 
41
socket location, and to govern the placement of its log file and of
 
42
the dribble file from the application underneath it
 
43
 
 
44
** attachtty  - the client
 
45
 
 
46
When you want to connect to the process, attachtty attaches to the
 
47
unix-domain socket and copies input/output to and from you.  
 
48
 
 
49
If you have ssh installed and set up, you can also use attachtty
 
50
across the network.  This requires 
 
51
 
 
52
- that you also have attachtty installed on the machine that you are
 
53
  running detachtty on, and that it's somewhere on the path
 
54
 
 
55
- that you have ssh set up not to need to ask for a password (e.g
 
56
  using ssh-agent)
 
57
 
 
58
It's often nice to be able to interrupt a process, especially when
 
59
it's stuck in some kind of loop.  attachtty catches SIGINT and sends
 
60
the character \003 into the pty master, which causes the controlled
 
61
process to get a SIGINT of its own.  This works at least for using
 
62
with ILISP and CMUCL.
 
63
 
 
64
* Using it - an example
 
65
 
 
66
server$ detachtty --help
 
67
detachtty: unrecognized option `--help'
 
68
usage: 
 
69
 detachtty [--no-detach] [--dribble-file name] [--log-file name] \
 
70
   [--pid-file name] socket-path command [arg] [arg] [arg] ...
 
71
 
 
72
server$ detachtty --dribble-file /var/log/cliki-dribble --log-file \
 
73
  /var/log/detachtty.log --pid-file /var/run/cliki.pid \
 
74
  /var/run/cliki-socket /usr/bin/lisp -eval '(load-system :telentweb)' \
 
75
  -eval '(progn (telentweb::init) (telentweb::start))' \
 
76
 
 
77
client$ attachtty dan@server:/var/run/cliki-socket
 
78
 
 
79
** Signals and log files
 
80
 
 
81
When detachtty receives a SIGHUP, it closes and reopens its log and dribble
 
82
files, so it should play nice with whatever log rotation tools you already
 
83
use.  Note that the dribble file especially can grow large quite quickly  
 
84
 
 
85
The SIGHUP should be sent to detachtty, not to the child.  What the child
 
86
does with signals depends entirely on what the child is ...
 
87
 
 
88
 
 
89
* Security considerations
 
90
 
 
91
- detachtty performs no authentication of who's attached.  You choose
 
92
where the socket is created in the filesystem, so choose somewhere
 
93
that other people can't get to.
 
94
 
 
95
(detachtty creates its socket with mode 0700.  Some Unix systems -
 
96
Linux among them - honour file permissions on sockets, so only the
 
97
original user or root will be able to connect to it.  However, "many
 
98
BSD derived systems [...] ignore permissions for Unix sockets" so you
 
99
need to check if this will help you or not.)
 
100
 
 
101
- communication across the net is done using ssh.  If there is a
 
102
program on your computer called "ssh", then whatever level of security
 
103
it provides is available here
 
104
 
 
105
- no serious effort has been made to examine the attachtty and
 
106
detachtty code for buffer overruns etc.  If you are planning on using
 
107
these setuid or in some other untrusted-user situation, now is the
 
108
time to think of an alternative plan.
 
109
 
 
110
 
 
111
* Where to get it
 
112
 
 
113
detachtty is part of the Debian GNU/Linux system.  Debian "woody" and
 
114
"sid" users should find that "apt-get install detachtty" will download
 
115
and install it for them.
 
116
 
 
117
Users of other platforms are invited to check the CLiki page at
 
118
<URL:http://ww.telent.net/cliki/detachtty> which should always contain
 
119
a link to a download location.
 
120
 
 
121
 
 
122
* Feedback, feature requests, patches
 
123
 
 
124
to dan@telent.net, or using the Debian bug tracking system (bug reports 
 
125
can be sent to the BTS even if you're not using Debian; it's exactly
 
126
the same package either way), or leave a note on the CLiki page