compiling.yo (6301B)
1 subsect(Prerequisites) 2 3 The creation of crossroads requires: 4 5 itemization( 6 it() Standard Unix tools, such as tt(sed), tt(awk), tt(Perl) 7 (5.00 or better); 8 9 it() A POSIX-compliant C compiler; 10 11 it() Support for SYSV IPC, networking and so on. 12 ) 13 14 Basically a Linux or Apple MacOSX box will do nicely. To compile and install 15 crossroads, follow these steps. 16 17 18 subsect(Compiling and installing) 19 20 itemization( 21 it() Obtain the source distribution. It can be found on 22 lurl(http://crossroads.e-tunity.com). The distribution comes as an 23 archive tt(crossroads-)em(type)tt(.tar.gz), where em(type) is 24 tt(stable) or tt(devel). 25 26 it() Unpack the archive in a sources directory using tt(tar 27 xzf crossroads-)em(X.YY)tt(.tar.gz). The contents spill into a 28 subdirectory tt(crossroads-)em(X.YY/). 29 30 it() Change-dir into the directory. 31 32 it() Next, edit tt(etc/Makefile.def) and verify that all 33 compilation settings are to your likings. The settings are 34 explained in the file. bf(Note that) the default distribution 35 of tt(Makefile.def) is suited for Linux or Apple MacOSX 36 systems. On other Unices, or on non-Unix systems, you must 37 particularly pay attention to tt(SET_PROC_TITLE_BY...). When 38 in doubt, comment out all tt(SET_PROC_TITLE...) 39 settings. Crossroads will work nevertheless, but it won't show 40 nice titles in tt(ps) listings. Also there's a macro 41 tt(EXTRA_LIBS) to add linkage flags (an example for a Solaris 42 build is included). 43 44 it() Now crossroads is ready for compilation. Do a tt(make 45 local) followed by tt(make install). The latter step may have 46 to be done by the user tt(root) if the tt(BINDIR) setting of 47 tt(etc/Makefile.def) points to a root-owned directory. 48 49 it() The documentation doesn't install in this process. If you 50 want to install the documentation, then proceed as follows: 51 52 itemization( 53 it() Optionally, tt(cp doc/crossroads.html) 54 em(htmldirectory/); where em(htmldirectory) is the destination 55 directory for your HTML manuals; 56 57 it() Optionally, tt(cp doc/crossroads.pdf) 58 em(pdfdirectory/); where em(pdfdirectory) is the 59 destination directory for your PDF manuals; 60 61 it() Optionally, tt(cp doc/crossroads.man) 62 em(manualdirectory)tt(/crossroads.1), where 63 em(manualdirectory) is e.g. tt(/usr/man/man1), 64 tt(/usr/share/man1), tt(/usr/local/man/man1), 65 tt(/usr/local/share/man1). Any possibility is valid, as 66 long as em(manualdirectory) is one of the directories 67 where manual pages are stored; 68 69 it() If your manual page system supports compressed 70 manual pages, then you can save some space with 71 tt(gzip) em(manualdirectory)tt(/crossroads.1).) 72 73 ) 74 75 76 subsect(Configuring crossroads) 77 78 Now that the binary is available on your system, you need to create a 79 suitable tt(/etc/crossroads.conf). Use this manual or the output of 80 tt(crossroads samplconf) to get started. 81 82 Once you have the configuration ready, start crossroads with 83 tt(crossroads start). Test the availability of your services and back 84 ends. Monitor how crossroads is doing with: 85 86 itemization( 87 it() In one terminal, run the script: 88 verb(\ 89 while [ 1 ] ; do 90 tput clear 91 crossroads status 92 sleep 3 93 done) 94 95 bf(Note) that depending on your system you might need 96 tt(sleep 3s), i.e., with an tt(s) appended. 97 98 it() In another terminal, run: 99 verb(\ 100 while [ 1 ] ; do 101 tput clear 102 ps ax | grep crossroads | grep -v grep 103 sleep 3 104 done) 105 106 bf(Note) that depending on your system you might need 107 tt(ps -ef) instead of tt(ps ax). 108 109 it() In yet another terminal, run tt(tail -f 110 /var/log/messages) (supply the appropriate system log file if 111 tt(/var/log/messages) doesn't work for you).) 112 113 Now thoroughly test the availability of your back ends through 114 crossroads. The status display will show an updated view of which back 115 ends are selected and how busy they are. The process list will show 116 which crossroads daemons are running. Finally, the tailing of 117 tt(/var/log/messages) shows what's going on -- especially if you have 118 tt(verbosity true) statements in the configuration. 119 120 121 subsect(A boot script) 122 123 Finally, you may want to create a boot-time startup script. The exact 124 procedure depends on the used Unix flavor. 125 126 subsubsect(SysV Style Startup) 127 128 On SysV style systems, there's a startup script directory 129 tt(/etc/init.d) where bootscripts for all utilities are located. 130 You may have the tt(chkconfig) utility to automate the task of 131 inserting scripts into the boot sequence, but 132 otherwise the steps will resemble the following. 133 134 itemization( 135 it() Create a script tt(crossroads) in tt(/etc/init.d) similar to the 136 following: 137 138 verb(\ 139 #!/bin/sh 140 /usr/local/bin/crossroads -v $@) 141 142 The stated directory tt(/usr/local/bin) must correspond with 143 the installation path. The flag tt(-v) causes the startup to 144 be more 'verbose'. However, once daemonized, the verbosity is 145 controlled by the appropriate statements in the configuration. 146 147 it() Determine your 'runlevel': usually 3 when your system is 148 running in text-mode only, or 5 when you are using a graphical 149 interface. If your runlevel is 3, then: 150 151 verb(\ 152 root> cd /etc/rc.d/rc3.d 153 root> ln -s /etc/init.d/crossroads S99crossroads 154 root> ln -s /etc/init.d/crossroads K99crossroads) 155 156 This creates startup (tt(S*)) and stop (tt(K*)) links that 157 will be run when the system enters or leaves a given runlevel. 158 159 If your runlevel is 5, then the right tt(cd) command is to 160 tt(/etc/rc.d/rc5.d). Alternatively, you can create the 161 symlinks in both runlevel directories.) 162 163 subsubsect(BSD Style Startup) 164 165 On BSD style systems, daemons are booted directly from tt(/etc/rc) and 166 related scripts. Incase you have a file tt(/etc/rc.local), edit it, 167 and add the statement: 168 169 verb(/usr/local/bin/crossroads start) 170 171 If your BSD system lacks tt(/etc/rc.local), then you may need to start 172 Crossroads from tt(/etc/rc). Your mileage may vary.