1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
|
How to Install Idled
====================
***Users of Idled v1.07 and older should see NOTE under***
***CONFIGURATION below.***
COMPILATION
===========
Edit the Makefile to select the type of system that you have by
removing the '#' marks in front of the line for your type of
system and putting them in front of the lines for the default
system, SVR4 -- Solaris 2.x.
If you use XDM, then you will probably want to add -DXDM_HACK
to the DEFS line for your system. If "last" reports that a
user on console is connected to some tty other than ":0", then
you will also need to change the XDM_DEV define in idled.h.
(If you have to change anything else in the Makefile for the
information to be correct for your system, please let me know.)
Idled v1.15 added a new feature to set limits based on where
a user is logged in from. As I don't know the utmp structure
on all systems, I have not defined UTMPHOST for some systems
that probably have ut_host in the utmp structure. If your
utmp.h indicates that your system does have ut_host in the
utmp structure, please let me know so I can update the Makefile.
You may wish to adjust the install directories for your system.
You may also wish to adjust the owner and group users for the
file for the 'make install' process. You can also adjust the
file priviledges (modes) as desired.
Special Notes for Certain Systems:
Linux: The two steps necessary for Linux after editing the
Makefile to choose the proper system is to:
make clean
make
That will delete parse.c and have yacc regenerate it,
which should avoid a 'struct qelem' problem and the
yyrestart() function problem.
If you have problems related to 'yyrestart' after the
'make clean', then it may be due to the fact that it
is assumed that Linux has the yyrestart() function.
If your's doesn't (or you get an "undefined function"
error), remove the -DHAVE_YYRESTART from the Makefile.
Solaris x86: The MOUSE_NAME defined in idled.h will be
incorrect for your system. It should be
set to one of the following:
Mouse Mode MOUSE_NAME
========== ==========
PS/2 style "/dev/kdmouse"
Logitech Bus "/dev/logi"
Microsft Bus "/dev/msm"
Serial "/dev/ttya" (or ttyb, for port 2)
The keyboard will use the same port, so the
KEYBOARD_NAME definition can be left to anything
that is not a real device (so it will be ignored).
BSDI:
BSD/OS2: parse.c will need to be deleted and recreated before
being compiled. You can either delete it by hand, or
do a 'make clean' followed by the normal 'make'.
Digital Unix: You may have problems with idled warning users
but never logging them off. This will probably
be true for DU 3.2, especially. If this is the
case, try recompiling with -DDISABLE_WARNS added
to the DEFS line of the Makefile. This will
prevent idled from warning, but should allow
logouts to work. This would be necessary to
work around a bug/oddity in this O.S.
The default in the CFLAGS line is to compile without debugging
information and without optimization. You can add the '-g' to
the CFLAGS line if you want debugging, or '-O' or whatever variant
is appropriate for your system if you desire a slightly smaller
executable. No useful core dumps will be made with optimization
(of course, those shouldn't ever happen, should they). :-)
NOTE: I have included my versions of the following files:
parse.c y.tab.h scan.c
These are files created from yacc and lex. If you have
problems trying to compile them, try doing deleting them
or doing a 'make clean' before compilation, so that these
files will be recreated on your system. I have included
them because I do not anticipate problems, and do not know
if some poor system out there might not have these useful
tools.
Once everything is all set up in the Makefile, just type 'make'
to start the compilation going.
INSTALLATION
============
Typing 'make install' as root will hopefully put the binary,
configuration file, and the two manual pages into the proper
locations with the owner and permissions specified in the
Makefile.
If it doesn't work, you may wish to try one of the other install
procedures with 'make install1' or 'make install#'. The number
of '#'s will change as I learn of more which are needed.
If none of these work, please send me the proper install command
calls you need for your system. You are on your own to find
those, but 'man install' should be helpful.
CONFIGURATION
=============
Before trying to run idled, you should set up its configuration
file which should now be installed. The default idled.cf file
has the general layout with some default information and examples
of the possibilities. Refer to the idled.cf(5) manual page for
more information on the configuration file.
***NOTE***
The form of the 'conswins' command changed in idled v1.10.
If you are using a config file from an older version of idled,
you *must* change this command appropriately for it to work
with the new version of idled. See CHANGES file or the
idled.cf man page for information on how to make the change.
EXECUTION (Running the program, not killing the users)
======================================================
Idled should now run by simply calling 'idled' as root (when in
the proper directory or specifying the path). If it either fails
to start or to show up in a process listing after starting it,
check the log file (default is /var/log/idled.log) to see if
idled gave an explanation of its exiting. The most common reason
for it to exit when first run is an error in the configuration
file, and this type of error will appear in the log file.
STARTING IDLED AT BOOT TIME
===========================
I know of two different install methods, which are listed below
under a short description for each:
SunOS 4.x (all BSD?) -- /etc/rc.local --:
****************************************
This type uses a few lines in the /etc/rc.local file to set
up some more local configuration things. In this type of
environment, the following few lines near the end of that
file might be sufficient to have idled start everytime the
machine is booted:
#
# Start idled
#
if [ -f /usr/local/bin/idled ]; then
/usr/local/bin/idled ; echo "Idle daemon started"
fi
This assumes the idled exectuable is in /usr/local/bin;
adjust as necessary.
Solaris 2.x (all SVR4?) -- /etc/rc#.d/* --:
This type uses a script in one of the rc#.d directories for
each program (usually) to be started or killed at the various
times. Assuming you are using the machine in multi-user
mode, an idled start script should go in rc2.d (multi-user
mode with network resources not exported) or rc3.d (same with
network resources exported). rc3.d is probably the prefered
choice. A script such as this, with a name such as S95idled
(the 'S' specifies that it be called with the 'start'
parameter, as opposed to 'K' for kill, which calls it with
'stop'; note that the higher the number, in this case 95, the
later the script is run; this may not matter much if there
are few or no other scripts in that directory):
#
# S95idled -- start or kill idled
#
if [ ! -d /usr/local/bin ]; then
exit # Can't find the directory.
# Perhaps /usr isn't mounted?
fi
case "$1" in
'start')
# Start idled
if [ -f /usr/local/bin/idled ]; then
/usr/local/bin/idled && echo "Idle daemon started"
else
echo "Could not find idled"
fi
;;
'stop')
# Find and kill idled
pid=`/usr/bin/ps -e | /usr/bin/grep idled | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
if [ "$pid" != "" ]; then
/usr/bin/kill $pid
echo "idled killed"
fi
;;
*)
echo "usage: S95idled {start|stop}"
;;
esac
Adjust the /usr/local/bin directory if it is not correct.
Also, the search method to find the pid, along with the paths
to ps, grep, sed, and kill, may vary for your particular
system.
That's all:
***********
With the appropriate one of these in place, or some other method
for your system, idled should now run whenever the machine boots
and hopefully kill off those bad users!
PROBLEMS?
=========
If you have problems, feel free to mail me for help, and I will
do my best.
Here is a helper if you get a
"too many users: Recompile with higher 'MAXUSERS' setting."
error message:
* Idled uses the utmp file to see what users are logged
in. The MAXUSERS setting is actually the number of
entries in the utmp file that Idled can handle. This
is usually close to the maximum number of users that
log onto a system, but may vary depending on the O.S.
and usage. To aid in increasing the MAXUSERS setting
in this situation, Idled v1.12 and up includes a sub-
program ('make utmplines') to tell you how many lines
are currently in your utmp file. The MAXUSERS setting
in idled.h should be greater than that number of lines.
If you *had* problems, and have patches to anything in this or
other Idled documentation or code, please mail me these patches
and a description of what system (as in O.S.) you are installing
Idled on.
Any other comments or suggestions appreciated.
--Mike Crider (crider@cs.hope.edu)
|