1 LPRng Installation 2 Patrick Powell <papowell@lprng.com> 3 Last Updated Sun Aug 19 14:49:25 PDT 2001 4 5SUPER EXPRESS INSTALLATION FOR TERMINALLY IMPATIENT SYSADMINS 6 7The "STANDARD configuration" is the most common configuration for UNIX/LINUX 8 systems: 9 - /etc/printcap, /etc/lpd.conf, /etc/lpd.perms configuration files 10 - executables in /usr/bin, /usr/sbin 11 - you do not need any include files from /usr/local/include 12 or libraries from /usr/local/lib 13 - no Kerberos support 14 15 ./configure --prefix=/usr --sysconfdir=/etc 16 make clean all 17 (as root): 18 make install 19 checkpc -f 20 21CAVEATS and WARNINGS: 22 23 The LPRng software requires an ANSI C compiler and a make utility that is 24 compatible with Gnu Make (verson 3.73 or later) or FreeBSD 4.2 or later. 25 LPRng is compiled and tested using GCC and Gnu Make. It uses libtool 26 to create a shared library on systems where this is supported. 27 28INCLUDE FILES AND LIBRARIES 29 30If you are using GETOPT or Kerberos you may need to extend the search 31paths for include files and libraries as shown below: 32 33 --with-ldopts="-L/usr/local/lib" \ 34 --with-cppopts="-I/usr/local/include" 35 OR (for example) 36 --with-ldopts="-L/usr/local/lib -L/usr/lib/krb5" \ 37 --with-cppopts="-I/usr/local/include -I/usr/include/krb5" 38 39Solaris Users: 40 41 You can get precompiled versions of the GCC compiler and GNU Make 42 from: 43 www.sunfreeware.com 44 45 The LPRng code has NOT been tested with the Sun Microsystems compilers, 46 and NOT been tested with 64 bit support enabled. 47 48 Your PATH environment variable MUST repeat MUST have /usr/local/bin 49 FIRST followed by /usr/ccs/bin: 50 51 PATH=/usr/local/bin:/usr/ccs/bin:$PATH 52 53 If you have ANY problems with compilation, and you are NOT using a 54 'clean' GCC installation, please install GCC from a package (see 55 http://www.sunfreeware.com) or recompile gcc and reinstall it. 56 Make sure that the include files are correct for your version 57 of Solaris. In fact, I recommend that you do the compilation on a 58 'clean' machine that has nothing but a 'virgin' Solaris Install + 59 utilities BEFORE reporting problems. 60 61 You have been warned. 62 63HPUX Users: 64 See the following site for precompiled GCC and other tools: 65 http://hpux.cae.wisc.edu/ 66 67 I STRONGLY recommend installing GCC and using GCC, especially 68 on HPUX 9.X and 10.X. Make sure that your include files are 69 the correct ones for your particular OS. 70 71 If you use the native or HP provided C compiler, you will need to 72 add some additional flags to allow ANSI C compatibility. The 73 -Aa and -Ae are candidates, but you will have to check your 74 particular compiler for details. 75 76 Ryan Novosielski <novosirj@umdnj.edu> suggests that 77 for HP-UX 11.0 and 11.11 you may need to use 78 --with-linker=/usr/bin/ld 79 80 You have been warned. 81 82EXTREMELY IMPORTANT WARNING FOR THE SANITY OF SYSADMINS 83 84 It is extremely dangerous to use NFS mounted file systems for spool 85 directories. The LPRng system depends on file locking for process 86 coordination and synchronization. Given the historical evidence 87 of problems with file locks and NFS, not to mention the terrible 88 performance impact, it is strongly recommended that you use a 89 local file system for your spool directories. 90 91 You have been warned. 92 93SYSTEM STARTUP SCRIPTS 94 95The software install procedures will attempt to create and install 96a startup script for the following systems: 97 98FreeBSD: /etc/rc.conf 99 The installation procedures will stop the LPD print spooler, 100 update the /etc/rc.conf file, and restart the LPD print spooler. 101 102RedHat Linux: RedHat /etc/init.d/lprng 103 The chkconfig utility will be used to set up LPRng 104 to run at level 345. 105 106Solaris: /etc/inetd.conf, /etc/init.d/lprng.sh 107 Removes the 'printer' entry from /etc/inetd.conf file 108 Also puts a startup script in /etc/init.d and 109 creates link to script in /etc/rc2.d. 110 111LINUX, System V, Solaris: 112 113 The print services startup file is in /etc/rc.d/init.d (or /etc/init.d) 114 and symbolic links are made to it from the rc<level>.d directories. 115 The links usually have the form NNNname, e.g.- 322lpr, where the NNN 116 is the order that the script is to be executed relative to the other 117 scripts and the 'name' is the name of the script in the /etc/rc.d/init.d 118 directory. 119 120 At startup time the script is invoked with the 'start' option and 121 at shutdown time with the 'stop' option. The following script 122 shows an example of how this is used. 123 124 #!/bin/sh 125 case "$1" in 126 start) 127 # Start daemons. 128 /usr/bin/echo "Starting lpd: \c"; /usr/local/bin/lpd; 129 /usr/bin/echo ""; 130 ;; 131 stop) 132 # Stop daemons. 133 /usr/bin/printf "Shutting down lpd: " 134 pkill lpd 135 /usr/bin/echo "done" 136 ;; 137 *) 138 echo "Usage: lpd {start|stop}" 139 ;; 140 esac 141 142 143Other distributions: 144 You will have to hand install 145 startup scripts. See the sample startup scripts on your 146 system and modify them appropriately. Usually all 147 that is done is to change the path to the lpd program 148 or lpsched program to use the LPRng lpd server. 149 150CONFIGURATION 151 152 The configure (autoconf) utility is used to specify the 153 location of files and run time options for the LPRng software. 154 155 configure (autoconf) defaults for files and directories: 156 ${prefix} - default is /usr/local 157 ${exec_prefix} - default is ${prefix} 158 ${bindir} is usually ${exec_refix}/bin, (/usr/local/bin) 159 ${sbindir} is usually ${exec_prefix}/sbin (/usr/local/sbin) 160 ${libdir} is usually ${exec_prefix}/lib (/usr/local/lib) 161 ${libexecdir} is usually ${exec_prefix}/libexec (/usr/local/libexec) 162 ${sysconfdir} is usually ${prefix}/etc (/usr/local/etc) 163 ${mandir} is usually ${prefix}/man (/usr/local/man) 164 165 CONFIGURATION FILES: 166 We install a sample lpd.conf, lpd.perms, and printcap in 167 ${sysconfdir}/lpd.conf.sample, lpd.perms.sample, 168 and printcap.sample; we make copies of the 169 sample files to lpd.conf, lpd.perms and printcap respectively. 170 171 EXECUTABLES AND SHARED LIBRARIES: 172 (* indicates SETUID root permissions) 173 ${bindir}/ lpr*, lprm*, lpq*, lpstat* 174 ${sbindir}/lpc*, checkpc, lpd 175 ${libdir}/liblpr.so, liblib.a 176 ${libexecdir}/filters/ lpf, banner, etc 177 ${sysconfdir}/ lpd.conf, lpd.perms, printcap 178 ${mandir}/ man pages 179 180 i.e. - /usr/local/bin/{lpr, lprm, ... } 181 /usr/local/sbin/{lpd, checkpc, lpc ... } 182 /usr/local/libexec/filters/{lpf, banner, etc } 183 184 STANDARD OR HISTORICALLY COMPATIBLE FILE LOCATIONS: 185 ./configure --prefix=/usr --sysconfdir=/etc 186 i.e. - /etc/printcap, /etc/lpd.conf, /etc/lpd.perms 187 /usr/local/bin/{lpr, lprm, ... } 188 /usr/local/sbin/{lpd, checkpc, lpc ... } 189 /usr/local/lib/{liblpr.so, liblpr.a, ... } 190 /usr/local/libexec/filters/{lpf, banner, etc } 191 192CONFIGURATION OPTIONS 193 194 In addition to the --prefix, etc., mentioned above, there are several 195 more you can use: 196 197 COMPILATION: 198 199 --with-cc=COMPILER select compiler to use 200 --with-linker=LINKER select linker to use 201 --with-ldopts=LDFLAGS linker command line options 202 --with-cppopts=CPPFLAGS compiler preprocessor command line options 203 --with-ccopts=CFLAGS compiler command line options 204 (use cppopts unless strictly for compiler) 205 --disable-strip do not strip binaries 206 --enable-shared[=PKGS] build shared libraries [default=yes] 207 --enable-static[=PKGS] build static libraries [default=yes] 208 --enable-fast-install[=PKGS] optimize for fast installation [default=yes] 209 --with-gnu-ld assume the C compiler uses GNU ld [default=no] 210 --disable-libtool-lock avoid locking (might break parallel builds) 211 --with-pic try to use only PIC/non-PIC objects [default=use both] 212 --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib 213 214 FILE LOCATIONS: 215 216 --with-lpddir=DIR lpd executable directory (default ${sbindir}) 217 --with-lpd_conf_path=PATH lpd.conf location (default: ${sysconfdir}/lpd.conf) 218 --with-lpd_perms_path=PATH lpd.perms location (default: ${sysconfdir}/lpd.perms) 219 --with-printcap_path=PATH printcap location (default ${sysconfdir}/printcap) 220 --with-lpd_printcap_path=PATH lpd_printcap location (default- not used ) 221 --with-lockfile=PATH lockfile PATH, default /var/run/lpd 222 --with-ld_library_path=PATH subprocess LD_LIBRARY_PATH environment variable 223 (default: /usr/lib:/usr/local/lib) 224 --with-filter_path=PATH subprocess PATH environment variable 225 (default: /usr/bin:/usr/local/bin) 226 --with-filterdir=DIR filter directory (default ${libexecdir}/filters) 227 --with-unix_socket_path=DIR unix socket path (default /dev/lprng) 228 229 OPERATION: 230 231 --disable-setuid disable setuid root client and server executables 232 --disable-unix_socket use unix socket for localhost connections 233 --enable-priv_ports require connections to be from privileged ports 234 --disable-force_localhost disable force_localhost default 235 --disable-require_configfiles client programs will not require lpd.conf 236 --enable-kerberos enable kerberos support 237 --enable-mit_kerberos4 enable MIT Kerberos 4 support 238 --disable-kerberos_checks disable kerberos library location and checking for support 239 --with-userid=NAME lpd runs as this userid, default daemon 240 --with-groupid=NAME lpd runs as this userid, default daemon 241 --with-chooser_routine=NAME load balance queue chooser routine name in user object file 242 --with-order_routine=NAME queue order routine name in user object file 243 --with-user_objs=NAME user specified object file 244 --with-user_include=NAME include file with function prototypes for user object file 245 246 CREATE AND INSTALL EXECUTABLES AND LIBRARIES 247 ./configure [ configuration options ] 248 make clean all; 249 su # you must do the following commands as root 250 make install 251 ./src/checkpc -f 252 253 STARTING LPD SERVER AND CHECKING CONFIGURATION 254 255 Use the following command to check to see that 256 the LPD server is running on the localhost: 257 258 #> lpc -s localhost lpd 259 260 If it has not been started, then you can start it by hand: 261 262 #> /usr/sbin/lpd 263 264INSTALLATION PROBLEMS 265 266If the installation step did not install the executables 267in the correct location or there are other problems, 268use the following procedures to fix up the install: 269 270 # kill off the old server 271 On BSD: 272 kill `ps -aux |grep lpd | awk '{print $2}'` 273 On System V: 274 kill `ps -e |grep lpd | awk '{print $1}'` 275 276You should remove or rename the original lpd binaries if they 277have are still present: 278 279 mv /usr/lib/lpd /usr/lib/lpd.old 280 ln -s /usr/local/bin/lpd /usr/lib/lpd 281 # you might want to track down the old lpr, lpq, lprm binaries 282 find /usr -type file -name lp\* -print >/tmp/candidates 283 find /sbin -type file -name lp\* -print >>/tmp/candidates 284 # Examine the /tmp/candidates file, and remove or rename the 285 # non-LPRng versions of the programs 286 # remove or rename the candidate files 287 /usr/local/sbin/lpd; # start up LPD 288 OR 289 /usr/sbin/lpd; # start up LPD 290 OR 291 /????/lpd # start up LPD 292 lpq; # test it with LPQ 293 294If you are running on Solaris, see the Solaris section in the LPRng 295Reference Manual for further instructions on integration with the 296LP subsystem. 297 298PRINTCAP FILES: 299 300Read the comments in the /etc/printcap.sample for details on 301how to set up a simple set of printcap entries. You may also 302want to read the LPRng Reference Manual and the Printing Cookbook 303documentation. 304 305SECURITY WARNINGS: 306 307 The default configuration for LPRng allows connections from 308 any port while a strict RFC1179 implementation would require 309 connections only from a port in the range 721-731. Relaxing 310 this restriction allows non-setuid root clients (lpr, lpq, etc) 311 to connect to the LPRng server. 312 313 The following is the default LPRng system installation: 314 315 1. All client programs are installed Setuid Root. 316 2. No checking is done for strict RFC1179 conformance by 317 the lpd server 318 3. By default, all client programs will connect to the server 319 on the local host (force_localhost configuration option). 320 321 This configuration allows you to connect directly to non-LPRng systems 322 using the LPRng clients, and to have the maximum flexibility with the 323 least amount of system configuration problems. You can modify the 324 /etc/printcap file, and set 'force_localhost@' to send jobs to 325 a remote print server which requires connections 326 to originate from a privileged port. 327 328 The described configuration has the drawback of having SETUID clients, 329 which is regarded as dangerous . 330 331 A more cautious approch is to use the following: 332 333 1. No LPRng programs are installed Setuid Root 334 (configure --disable-setuid) 335 2. All clients communicate directly to the server on the localhost. 336 (i.e. - force_localhost is used) 337 3. The server is started are system initialization time by root 338 and it is the only program that opens a connection to a 339 remote print spooler. This now reduces the problem 340 to a much more manageable level. 341 342 If you are truly paranoid then you should read the LPRng Refernece 343 Manual and the Printing Cookbook sections on Authentication, and 344 add either PGP or Kerberos authentication to your system. 345 346KERBEROS: 347 348 LPRng uses the MIT Kerberos 5 distribution and provides backwards 349 compatibility with the MIT Kerberos 4 print support system. 350 351 If you want to use Kerberos authentication then configure with 352 the following options: 353 354 - for Kerberos 5 only: 355 ./configure --enable-kerberos 356 - for Kerberos 5 and Kerberos 4 legacy support: 357 ./configure --enable-kerberos --enable-mit_kerberos4 358 359 You may need to add the following if your libraries and include files are 360 not in the 'usual' places. Replace /usr/local/lib with the directory 361 where the Kerberos libraries are and /usr/local/include where the include 362 files are. 363 364 --LDFLAGS="-L/usr/local/lib" \ 365 --CPPFLAGS="-I/usr/local/include" 366 367 --- CONFIGURE (autoconf) DOCUMENTATION --- 368 369Basic Installation 370================== 371 372 These are generic installation instructions. 373 374 The `configure' shell script attempts to guess correct values for 375various system-dependent variables used during compilation. It uses 376those values to create a `Makefile' in each directory of the package. 377It may also create one or more `.h' files containing system-dependent 378definitions. Finally, it creates a shell script `config.status' that 379you can run in the future to recreate the current configuration, a file 380`config.cache' that saves the results of its tests to speed up 381reconfiguring, and a file `config.log' containing compiler output 382(useful mainly for debugging `configure'). 383 384 If you need to do unusual things to compile the package, please try 385to figure out how `configure' could check whether to do them, and mail 386diffs or instructions to the address given in the `README' so they can 387be considered for the next release. If at some point `config.cache' 388contains results you don't want to keep, you may remove or edit it. 389 390 The file `configure.in' is used to create `configure' by a program 391called `autoconf'. You only need `configure.in' if you want to change 392it or regenerate `configure' using a newer version of `autoconf'. 393 394The simplest way to compile this package is: 395 396 1. `cd' to the directory containing the package's source code and type 397 `./configure' to configure the package for your system. If you're 398 using `csh' on an old version of System V, you might need to type 399 `sh ./configure' instead to prevent `csh' from trying to execute 400 `configure' itself. 401 402 Running `configure' takes awhile. While running, it prints some 403 messages telling which features it is checking for. 404 405 2. Type `make' to compile the package. 406 407 3. Optionally, type `make check' to run any self-tests that come with 408 the package. 409 410 4. Type `make install' to install the programs and any data files and 411 documentation. 412 413 5. You can remove the program binaries and object files from the 414 source code directory by typing `make clean'. To also remove the 415 files that `configure' created (so you can compile the package for 416 a different kind of computer), type `make distclean'. There is 417 also a `make maintainer-clean' target, but that is intended mainly 418 for the package's developers. If you use it, you may have to get 419 all sorts of other programs in order to regenerate files that came 420 with the distribution. 421 422Compilers and Options 423===================== 424 425 Some systems require unusual options for compilation or linking that 426the `configure' script does not know about. You can give `configure' 427initial values for variables by setting them in the environment. Using 428a Bourne-compatible shell, you can do that on the command line like 429this: 430 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure 431 432Or on systems that have the `env' program, you can do it like this: 433 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure 434 435Compiling For Multiple Architectures 436==================================== 437 438 You can compile the package for more than one kind of computer at the 439same time, by placing the object files for each architecture in their 440own directory. To do this, you must use a version of `make' that 441supports the `VPATH' variable, such as GNU `make'. `cd' to the 442directory where you want the object files and executables to go and run 443the `configure' script. `configure' automatically checks for the 444source code in the directory that `configure' is in and in `..'. 445 446 If you have to use a `make' that does not supports the `VPATH' 447variable, you have to compile the package for one architecture at a time 448in the source code directory. After you have installed the package for 449one architecture, use `make distclean' before reconfiguring for another 450architecture. 451 452Installation Names 453================== 454 455 By default, `make install' will install the package's files in 456`/usr/local/bin', `/usr/local/man', etc. You can specify an 457installation prefix other than `/usr/local' by giving `configure' the 458option `--prefix=PATH'. 459 460 You can specify separate installation prefixes for 461architecture-specific files and architecture-independent files. If you 462give `configure' the option `--exec-prefix=PATH', the package will use 463PATH as the prefix for installing programs and libraries. 464Documentation and other data files will still use the regular prefix. 465 466 In addition, if you use an unusual directory layout you can give 467options like `--bindir=PATH' to specify different values for particular 468kinds of files. Run `configure --help' for a list of the directories 469you can set and what kinds of files go in them. 470 471 If the package supports it, you can cause programs to be installed 472with an extra prefix or suffix on their names by giving `configure' the 473option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 474 475Optional Features 476================= 477 478 Some packages pay attention to `--enable-FEATURE' options to 479`configure', where FEATURE indicates an optional part of the package. 480They may also pay attention to `--with-PACKAGE' options, where PACKAGE 481is something like `gnu-as' or `x' (for the X Window System). The 482`README' should mention any `--enable-' and `--with-' options that the 483package recognizes. 484 485 For packages that use the X Window System, `configure' can usually 486find the X include and library files automatically, but if it doesn't, 487you can use the `configure' options `--x-includes=DIR' and 488`--x-libraries=DIR' to specify their locations. 489 490Specifying the System Type 491========================== 492 493 There may be some features `configure' can not figure out 494automatically, but needs to determine by the type of host the package 495will run on. Usually `configure' can figure that out, but if it prints 496a message saying it can not guess the host type, give it the 497`--host=TYPE' option. TYPE can either be a short name for the system 498type, such as `sun4', or a canonical name with three fields: 499 CPU-COMPANY-SYSTEM 500 501See the file `config.sub' for the possible values of each field. If 502`config.sub' isn't included in this package, then this package doesn't 503need to know the host type. 504 505 If you are building compiler tools for cross-compiling, you can also 506use the `--target=TYPE' option to select the type of system they will 507produce code for and the `--build=TYPE' option to select the type of 508system on which you are compiling the package. 509 510Sharing Defaults 511================ 512 513 If you want to set default values for `configure' scripts to share, 514you can create a site shell script called `config.site' that gives 515default values for variables like `CC', `cache_file', and `prefix'. 516`configure' looks for `PREFIX/share/config.site' if it exists, then 517`PREFIX/etc/config.site' if it exists. Or, you can set the 518`CONFIG_SITE' environment variable to the location of the site script. 519A warning: not all `configure' scripts look for a site script. 520 521Operation Controls 522================== 523 524 `configure' recognizes the following options to control how it 525operates. 526 527`--cache-file=FILE' 528 Use and save the results of the tests in FILE instead of 529 `./config.cache'. Set FILE to `/dev/null' to disable caching, for 530 debugging `configure'. 531 532`--help' 533 Print a summary of the options to `configure', and exit. 534 535`--quiet' 536`--silent' 537`-q' 538 Do not print messages saying which checks are being made. To 539 suppress all normal output, redirect it to `/dev/null' (any error 540 messages will still be shown). 541 542`--srcdir=DIR' 543 Look for the package's source code in directory DIR. Usually 544 `configure' can determine that directory automatically. 545 546`--version' 547 Print the version of Autoconf used to generate the `configure' 548 script, and exit. 549 550`configure' also accepts some other, not widely useful, options. 551