• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

AUTHORSH A D30-Jan-2003320 129

COPYINGH A D15-Dec-200217.6 KiB341281

ChangeLogH A D18-Feb-20031.6 KiB5129

INSTALLH A D15-Dec-20029 KiB230175

Makefile.amH A D03-Jan-2003150 105

Makefile.inH A D17-Feb-200315.1 KiB477396

NEWSH A D28-Jan-200334 11

READMEH A D18-Feb-200314 KiB283235

aclocal.m4H A D17-Feb-200328.3 KiB786664

configureH A D17-Feb-2003116.2 KiB3,8973,110

configure.inH A D17-Feb-2003590 3420

depcompH A D15-Dec-200211.8 KiB424278

install-shH A D15-Dec-20026.2 KiB277169

missingH A D15-Dec-200210 KiB337263

mkinstalldirsH A D15-Dec-20021.9 KiB11285

spinner.cH A D18-Feb-200327.6 KiB1,111647

spinner.hH A D07-Feb-20033 KiB9939

usage.cH A D18-Feb-20033.5 KiB8442

usage.hH A D30-Jan-2003947 355

README

1---------------------------------------------------
2spinner 1.2 by Joe Laffey, LAFFEY Computer Imaging.
3---------------------------------------------------
4Doc: $Revision: 1.5 $
5
6Visit http://www.laffeycomputer.com/ for updates.
7
8
9	This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22
23-------------
24WHAT IS IT?
25-------------
26
27Spinner is an anti-idle program that displays a little "spinning" ASCII
28character in the top left corner of your terminal. To make this effect it
29cycles through punctuation marks like this " - \ | / - \ | / ... " (try it to
30see). By default the character is drawn in inverse video (or your terminal's
31equivalent). But you can turn this off with the -i switch. In spinner mode
32Spinner supports any terminal capable of handling VT100 style escape codes. In
33null mode (-n switch) Spinner supports any terminal. In null mode there is no
34visible output, and Spinner will not interfere with your terminal or
35scrollback. If you find the little spinner in the top left corner to be
36distracting use null mode. (-n switch).
37
38Spinner is useful for keeping telnet and ssh links from dropping due to
39inactivity. Many firewalls, and some ISPs drop connections when they are
40perceived as idle. By having spinner running the server is constantly
41sending a tiny amount of data over the link, preserving the connection. As of
42version 1.2 Spinner can also be activated with the -n switch so that, instead
43of displaying a spinner, it simply sends out a periodic null character to the
44terminal. This achieves the same anti-idle benefit without disturbing your
45screen. But it lacks the coolness factor of a little spinner in the corner
46of the terminal...
47
48Thus (for search engines) Spinner is an anti-idle, timeout preventing,
49background daemon process for unix variants including linux. Spinner is
50known to compile and work properly under NetBSD 1.5 and 1.6, Mac OS X 10.2,
51linux 2.2 and 2.4.
52
53Spinner also has a (mainly fun) mode I like to call "Ghost in the Machine"
54mode. In this mode you can use spinner to write the spinner character to
55ANY tty, not just your own. This requires adequate permissions, of course.
56(see below)
57
58
59-----------------
60HOW DO I USE IT?
61-----------------
62
63Basic summary: (spinner -h)
64
65
66Usage:  spinner[-IntTuvl<path>[f<path>|F][p<prio>|P]] [delay]
67        -f   <path> Set pid file path (default is ~/.spinner.pid)
68        -F   Do *not* create a pid file
69        -I   Do *not* use inverse video for spinner
70        -l   <path> Set log file path (for debugging). Off by default.
71        -L   Display the license
72        -n   Send only null characters. (No visible output.)
73        -p   <priority> Specify process priority to use
74        -P   Do *not* change process priority (default is to make nice)
75        -r   Reset term on quit (Use if you get left in inverse a lot.)
76        -R   Reset the term and Quit immediately. (nothing else)
77        -t   <tty path> Specify path of TTY to which to write
78        -T   Ignore incompatible TERM environment var setting
79        -u   Delay is in microseconds instead of seconds
80        -v   Verbose mode (lots of output)
81Returns: 0 on success, non-zero on failure.
82Launches into the background on success.
83Use: kill `cat <pidfile>` to stop.
84
85
86
87----------------
88IMPORTANT INFO   <--read this
89----------------
90
91* IN ORDER FOR SPINNER TO PREVENT IDLE CONNECTIONS YOU MUST RUN IT ON THE
92SERVER. If you run Spinner on your client the data is not sent over the
93wire. It is only drawn locally. So you must run Spinner on the remote
94machine to keep the data coming to your terminal over the wire. If you do
95not have root access on the remote machine you can still use Spinner.
96Compile Spinner with "./configure --prefix=</your/bin/dir> && make install".
97You can then launch Spinner from your .login file or .tcshrc / .profile
98file if you wish.
99
100* Spinner is a daemon process (also known as a background process). When
101you start spinner it will launch into the background as not to interfere
102much with your foreground jobs. By default Spinner creates a pid (process
103id) file called ".spinner.pid" in your home directory. (You may use the -f
104or -F switches to modify this behavior.) Note this pid file has a "."
105character in front so you will need to use ls -a to see it in a listing.
106You can use this file to easily kill Spinner with the command:
107
108   kill `cat ~/.spinner.pid`
109
110Note that those are backticks (top left key below ESC, same key with ~).
111Of course you can also just find Spinner in your process list and kill
112it manually that way. Spinner's pid file is NOT a lock file. It will be
113overwritten every time you launch a copy of Spinner. So if you have
114multiple spinners running you will have to kill them manually.
115
116Spinner should commit suicide (i.e. quit) if the tty to which it is
117writing is no longer active. Sometimes, if you start Spinner writing
118to another tty when that tty is not active to begin with Spinner will
119not quit. (Anyone know why?? Tell me.)
120
121* Since Spinner draws to the terminal it is possible (and likely) that
122the spinner character will end up in the terminal's scrollback. To
123reduce this annoyance you can use a long delay. As of version 1.2 you may
124opt to use the -n switch to cause spinner to send only null characters,
125instead of the spinning cursor. If you do not use -n you may also kill
126Spinner with the STOP signal (kill -STOP `cat ~/.spinner.pid`) and
127then continue it after you get your scrollback via the CONT signal
128(kill -CONT `cat ~/.spinner.pid`).
129
130* Spinner may interfere with the display of mouse selections. If you drag
131out a selection the highlighted text may become unhighlighted as sooner
132as Spinner draws to the terminal. Typically the contents of the paste
133buffer still remain, however. So even though you lose the highlighting
134you can still paste the text that you selected in the usual fashion.
135Again, as of version 1.2 you may opt to use the -n switch to cause
136Spinner to only send null characters to the screen (which do not show up).
137
138* At startup spinner checks to be sure your TERM environment variable
139is set to "vt100" or "vt102". It only checks for these since these are
140the only terminal types that I KNOW will accept the vt100 escape codes
141(to move the cursor, inverse video, etc.) Spinner works perfectly
142well in every terminal I have tried it in (including GNU screen, eterm,
143xterm, aterm, etc.) If you get the message about your terminal not
144being "vt100" or "vt102" simply invoke Spinner with the -T switch. This
145forces Spinner to ignore the TERM setting. Note that if you use spinner
146on a dumb terminal, or any other terminal that does not support the
147escape codes you will see a lot garbage characters. Just stop Spinner
148and get a real terminal! If you find this check annoying, or think
149it should go away let me know. Note that if you use the -n switch Spinner
150will not check the terminal type at all, as it is not attempting to move
151the cursor, change inverse modes, etc.
152
153* Note that if you would like to use Spinner in conjunction with the GNU
154screen program (one of the world's coolest programs, screen is a
155"terminal multiplexer" allowing multiple virtual terminals in a single
156terminal window, switching between them, detaching and resuming screens
157both local and remote, etc.) you will want to start Spinner *BEFORE* you
158start screen. Otherwise Spinner will end up in one of screen's virtual
159terminals, which means that it may not be on the real terminal all the
160time. This could lead to an idle timeout, which is exactly what Spinner
161was coded to prevent. You may also be able to determine your parent
162tty (the original tty from which you invoked screen), and have Spinner
163write to that tty using the -t switch. (This would let you invoke
164Spinner in such a way that it would write to the parent terminal even
165though you launched Spinner from within screen.
166
167* In normal operation (delay >= 2 sec) Spinner functions well with most
168terminals / emulators. However, if you switch to microsecond mode for
169the delay (-u) and use lower delays it is possible that your terminal
170will become somewhat garbled. You will notice that parts of the screen
171that shouldn't be are displayed in inverse text, or text is in the wrong
172place, etc. Setting a higher delay will normally make this issue
173non-existent. Note that "Terminal.app" under Mac OSX seems more prone to
174do this. Gnome term and eterm, etc seem immune. **NOTE: In version 1.2
175the code was reworked to all but eliminate this. If you encounter this
176issue, please send me an email with your system info. Since
177when using the -n switch Spinner does not send printable characters you will
178not experience this problem at all.
179
180* If you use an extremely low delay on a slow link, or use a slow-drawing
181terminal, be prepared for Spinner to slow your terminal down. I would say,
182"Don't do that!" Spinner is coded to be very efficient in its main loop.
183Only one write statement and one check to be sure the tty is active per
184iteration. Since Spinner is meant as an anti-idle tool you will most
185likely keep the delay high (but less than 30 sec or so depending upon
186what it is that is timing out your connection to begin with).
187
188* By default Spinner will set its process priority (niceness) to 10. You
189can use the -p or -P switches to modify this behavior.
190
191* Sometimes when you terminate Spinner it could leave the terminal in a
192state you were not expecting (e.g. inverse video "stuck" on, cursor in
193the wrong spot, etc.) If you experience this a lot consider the -r switch.
194This will send a vt100 reset code at quit, which usually helps, but will
195clear your terminal screen. **NOTE: In version 1.2 the code was reworked
196to all but eliminate this. If you encounter this issue, please send me an
197email with your system info.
198
199If your terminal gets stuck in an inconsistent (read "whacked") state you
200can try to fix it by running Spinner with the -R switch. With this switch
201ALL Spinner will do is sen a vt100 reset code to the tty (then quit).
202
203Using the -n switch will avoid these problem altogether by sending only
204null characters to the terminal. You loose the cool little spinner effect,
205however.
206
207* Verbose mode will walk you through most of the steps Spinner takes as it
208launches. Mainly for debugging, it can, however, help you troubleshoot
209switch settings. Note that once Spinner has forked to the background it
210no longer has a controlling terminal and cannot output error messages.
211In or to see verbose output (or errors) after the fork you must use the
212-l switch and specify a filename to write to. This file will ONLY
213contain the output from Spinner AFTER the fork. Most likely you will
214never need this, but it is available if you do. Note that it t is
215perfectly normal to see a no such file or directory error in this log when
216logging out of linux. Linux cretaes and deletes files in /dev/pts/ with
217every change of TTY.
218
219* Ghost in the Machine mode (i.e. using the -t switch to write to another
220tty other than your controlling terminal) can be both fun and (a little)
221useful. To use this mode determine the PATH to the tty you want Spinner
222to write. Usually the "tty" command will display your own terminal. This
223should give you the basic path/filename structure (usually "/dev/ttypXX"
224where "XX" is a number). Then do a "who" command to see which particular
225tty you want to write to. This will show you a list of logged in users
226and their ttys. Next run spinner with the -t switch and specify the path
227to the desired tty. Note that you must have permission to write to the
228desired tty. Ttys are setup to be owned by the user logged into them, and
229usually setup with a group of "tty". So you can always write to any of
230your own ttys. To write to someone else's tty you either need to be root,
231or root needs to setup Spinner as setgid (not setuid) "tty". There are
232security concerns with any setuid or setgid program. So don't be
233surprised if your administrator says no. Spinner has not been thoroughly
234audited for security. Though little could go wrong, small seemingly
235meaningless things can lead to real big security holes. You've been
236warned. Spinner is NOT installed setgid (or setuid) by using the
237"make install" command. Spinner will not run if it is made setuid.
238
239
240
241-------------
242TO DO
243-------------
244
245Allowing the user to specify the position of the spinning character
246might be fun, and somewhat useful.
247
248Perhaps putting the spinner into a banner at the top or bottom of the
249screen (like GNU screen's dividers) would be useful, as they spinner
250would not encroach into the active terminal area (the virtual terminal
251would be made smaller)
252
253Adding a spinner to the existing banner in the GNU screen program would
254be very useful for those who use screen.
255
256Calls to signal() should be replaced with sigaction() stuff.
257
258Any way to prevent scrollback of the spinner character instead of valid
259data would be useful (such as the banner at the bottom previously
260mentioned).
261
262Perhaps a switch to kill running Spinner(s) instead of using the kill
263command might be useful for novice users. However, novice users are
264unlikely to be using Spinner to begin with...
265
266-------------------------------
267Who Made This Thing? (and Why?)
268-------------------------------
269Original code:
270	Joe Laffey <software@laffeycomputer.com>
271	I made it to keep alive ssh connections that were being timed out by
272	my firewalls. Plus it looks cool, and was a nice experiment in
273	writing directly to ttys.
274
275Beta Testers:
276	Jonathan Dickmann <bob@bobarmadillo.com>
277	Michael Hostbaek <mich@freebsdcluster.org>
278	Patrick Norman <saitan@packetmonkeys.com>
279	Evlampy Oduvanchikoff <necro@netbastards.org>
280	Ed Okerson <eokerson@texasconnect.net>
281
282Thank You!
283