94 lines
No EOL
6.9 KiB
HTML
94 lines
No EOL
6.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>CLiki: detachtty</title>
|
|
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
|
|
href="https://www.cliki.net/site/feed/article.atom?title=detachtty">
|
|
<link rel="stylesheet" href="static/css/style.css">
|
|
<link rel="stylesheet" href="static/css/colorize.css">
|
|
</head>
|
|
|
|
<body>
|
|
<span class="hidden">CLiki - detachtty</span>
|
|
<div id="content"><div id="content-area"><div id="article-title">detachtty</div><div id="article">detachtty is a <a href="Unix.html" class="category">Unix</a> utility that lets you run interactive programs (such as Lisp) non-interactively.
|
|
Also, it allows you to connect to them over the network when you do need to interact with them.
|
|
It's intended for use with long-running server processes running in
|
|
<a href="Common Lisp implementation.html" class="internal">Common Lisp implementation</a>s.<p>If you've used <a href="screen.html" class="internal">screen</a>, it's a similar concept, but more suited to traditional scrolling interfaces whereas screen is better for full-screen (e.g. curses-based) apps. Compared to <a href="screen.html" class="internal">screen</a>, detachtty<p><ul>
|
|
<li>has no capability to swap between different screens (doesn't eat C-a)
|
|
</li>
|
|
<li>runs in line-at-a-time mode with no tty emulation (you can sanely use it in emacs comint modes or from inside a script(1) session)
|
|
</li>
|
|
<li>has no features (less to go wrong)
|
|
</li>
|
|
<li>and thus doesn't need a configuration file either
|
|
</li>
|
|
</ul><p><h2>Example usage</h2><p><pre>
|
|
server$ detachtty --dribble-file /var/log/cliki-dribble --log-file \
|
|
/var/log/detachtty.log --pid-file /var/run/cliki.pid \
|
|
/var/run/cliki-socket /usr/bin/lisp -eval '(load-system :telentweb)' \
|
|
-eval '(progn (telentweb::init) (telentweb::start))' \
|
|
|
|
client$ attachtty dan@server:/var/run/cliki-socket
|
|
|
|
</pre><p><i>to quit attachtty press <b>^\</b></i><p><h2>Running via detachtty at startup</h2><p>Start a script late .. i.e. S9xlispapp in rc[2|3].d/ <p><i>start S9xlispapp</i>
|
|
<pre>
|
|
#!/bin/sh
|
|
su - user -c /path/to/lisp-app-script
|
|
</pre>
|
|
<i>end S9xlispapp</i><p><i>start lisp-app-script</i>
|
|
<pre>
|
|
#!/bin/sh
|
|
|
|
detachtty --dribble-file /var/log/lisp-app-dribble --log-file \
|
|
/var/log/detachtty.log --pid-file /var/run/lisp-app.pid \
|
|
/var/run/lisp-app-socket /usr/bin/lisp -eval '(start-lisp-app)'
|
|
</pre>
|
|
<i>end lisp-app-script</i><p>-quasi (credit to Eduardo Muñoz for this information)<p>A more featureful init.d startup script for debian and compatible linuxes is introduced in <a href="https://boinkor.net/2006/02/starting-daemonized-lisp-images-in-debian/">
|
|
https://boinkor.net/2006/02/starting-daemonized-lisp-images-in-debian/</a><p><h2>Actual usage</h2><p>detachtty is running the <a href="SBCL.html" class="internal">SBCL</a> instance that <a href="CLiki.html" class="internal">CLiki</a> runs on<p><h2>Compatibility</h2><p>detachtty is mostly tested on <a href="Debian.html" class="category">Debian</a> GNU/Linux, but contributed patches for <a href="FreeBSD.html" class="internal">FreeBSD</a> and <a href="Solaris.html" class="internal">Solaris</a> have been merged into it, so it's probably not too hard to get running on many Unices<p><s>apparently, it worked on macos at one time, but that is no longer true under macos 10.4 (tiger). It seems that tiger's poll does not work as advertised.</s> it works on Tiger using <a href="https://ports.macports.org/port/poll-emulator/summary">poll-emulator from MacPorts</a> ("OS_LOADLIBES=-lpoll -L/opt/local/lib" is the only change required to make it work on Intel, but I'm having some issues on PPC) <p><h2>Download</h2><p>i386 Debian and source packages (currently at version 9) are at <strike>ftp://ftp.linux.org.uk/pub/lisp/detachtty/</strike>. This package is also
|
|
available in the main Debian repository. There's also a FreeBSD port, <tt>misc/detachtty</tt>, which you can get from the ports tree.<p>A new version, which includes the ability to set timeouts and pass code to the detach'd lisp (for better scriptablity) is available in the darcs repo at:<p><strike>http://common-lisp.net/project/bese/repos/detachtty</strike><p>Patches against that code would are more than welcome.<p><hr>
|
|
Remark: <p>When I started my Lisp image at Systemstart I got always errors like:
|
|
<pre>c-string encoding error (:external-format :ASCII):
|
|
the character with code 195 cannot be encoded.
|
|
[Condition of type SB-INT:C-STRING-ENCODING-ERROR]</pre><p>But it worked when I tried to start my Lisp image via the init.d script in the comandline.<p>The problem was solved when I added the following declarations to my init.d script:
|
|
<pre>
|
|
LC_CTYPE=en_US.UTF-8
|
|
export LC_CTYPE
|
|
</pre><p>See also: <a href="https://cl-pdx.com/comp.lang.lisp/2007/jun/220316.html">comp.lang.lisp thread</a></div></div>
|
|
<div id="footer" class="buttonbar"><ul><li><a href="detachtty.html">Current version</a></li>
|
|
<li><a href="https://www.cliki.net/site/history?article=detachtty">History</a></li>
|
|
<li><a href="https://www.cliki.net/site/backlinks?article=detachtty">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=detachtty&from-revision=3847324827">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
|
|
</div>
|
|
<div id="header-buttons" class="buttonbar">
|
|
<ul>
|
|
<li><a href="https://www.cliki.net/">Home</a></li>
|
|
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
|
|
<li><a href="CLiki.html">About</a></li>
|
|
<li><a href="Text Formatting.html">Text Formatting</a></li>
|
|
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
|
|
</ul>
|
|
<div id="search">
|
|
<form action="https://www.cliki.net/site/search">
|
|
<label for="search_query" class="hidden">Search CLiki</label>
|
|
<input type="text" name="query" id="search_query" value="" />
|
|
<input type="submit" value="search" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div id="pageheader">
|
|
<div id="header">
|
|
<span id="logo">CLiki</span>
|
|
<span id="slogan">the common lisp wiki</span>
|
|
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
|
|
<label for="login_name" class="hidden">Account name</label>
|
|
<input type="text" name="name" id="login_name" class="login_input" />
|
|
<label for= "login_password" class="hidden">Password</label>
|
|
<input type="password" name="password" id="login_password" class="login_input" />
|
|
<input type="submit" name="login" value="login" id="login_submit" /><br />
|
|
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
|
|
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body></html> |