QUICK INSTALLATION GUIDE

Kirara ver.1.5 (Kirara1)
Kirara ver.2.2 (Kirara2)

Installtion guide is essentially same as previous version.
If you are user of previous version, you need only:
(a) unpack kirara-2.2.tgz
(b) mk install
(c) setup (setup command)
(d) change kirara.conf and db.conf for your own needs

Kirara-2.2a is a bug fix version to Kirara-2.2.
The fix is very small.
If you have already installed Kirara-2.2, look CHANGES to fix.




This guide is for cwfs.
For fossil, look appendix (D).

(1) Decide dadabase you apply.
	Kirara1 or Kirara2 or both. (look QUICK_GUIDE)
	and decide their location.
	# If your fs is cwfs
	If your fs is cwfs, recommended locations are:
	/n/other/kirara1 for Kirara1
	and
	/n/other/kirara2 for Kirara2
	and register environment variables to $home/lib/profile:
	kirara1=/n/other/kirara1
	kirara2=/n/other/kirara2

	# If your fs is fossil
	If your fs is fossil, use kfs for Kirara.
	The recommended locations are:
	/n/kfs/kirara1 for Kirara1
	and
	/n/kfs/kirara2 for Kirara2
	and assuming you are already running kfs,
	register environment variables to $home/lib/profile:
	kirara1=/n/kfs/kirara1
	kirara2=/n/kfs/kirara2
	if(! test -e /n/kfs/adm/users)
		mount /srv/kfs /n/kfs

(2) Create /n/other/kirara1 or /n/other/kirara2 or both
	Don't forget to chmod 755 to them
	# if you feel difficult in creating them, look appendix (C).

(3) Install
	# NB: kfind1,kfind2,G1, G2 and mkdbL will be installed to $home/bin/rc
	# NB: Kirara specific executable binary will be installed to $home/bin/$objtype/kirara
	mkdir $home/bin/$objtype/kirara
	# assuming current directory is $home/src/Kirara
	gunzip kirara-2.2.tgz
	tar xf kirara-2.2.tar
	cd kirara-2.2
	mk install	# install binary to $home/bin/$objtype/kirara
	setup	# setup using environment variables kirara1 and kirara2

(4) Build database
	# Let $kirara be $kirara1 or $kirara2 (Kirara location)
	cd $kirara/sysdb
	# change the line in db.conf to reflect your preference.
	# target=(....)
	# exclude='...'
	mkdb -b		# takes a long time depending on your system
	cd $kirara/usrdb
	# change the line in db.conf to reflect your preference.
	# target=(....)
	# exclude='...'
	mkdb -b		# takes a long time depending on your system
	# look also $kirara/kirara.conf for $exclude

(5) Update
	# Kirara does not update automatically
	# NB: mkdb has a problem due to mtime bug of cwfs.
	# I provided elnfs to avoid this bug.
	# look Appendix (A) to install elnfs.
	# The followings are for Kirara1.
	cd $kirara1/usrdb
	mkdb -r	# if you don't install elnfs
	mkdb -L	# if you have installed elnfs (usrdb only)
	# NB: you need to have a file "eventlog" to enable "-L" option 
	touch /n/other/kirara1/usrdb/eventlog
	# elnfs enables update faster
	# NB: sysdb does not use elnfs
	# For Kirara2, replace $kirara1 by $kirara2


Appendix

(A) How to install elnfs
	# NB: if you have old version of elnfs, stop running and reinstall elnfs.
	# the format is changed from Kirara ver.1.2 to ver.1.3/ver2.0
	# NB: if you are already runnung lnfs, stop lnfs and use elnfs.
	elnfs=$home/bin/$objtype/kirara/elnfs
	# before you run rio, exec one of commands below somewhere
	$elnfs -fs elnfs /usr			# if your fs is cwfs64x
	$elnfs -fs elnfs -l 0 /usr		# if your fs is fossil
	$elnfs -fs elnfs -l 28 /usr	# if your fs is cwfs32
	$elnfs -fs elnfs -l 56 /usr	# if your fs is cwfs64
	# NB: if you need name conversion, you must have "/usr/.longnames"
	#	with the permission: read/write
	#	and append only flag is better for example
	a-rw-rw-r-- M 151 arisawa arisawa 412 Apr  1 11:32 .longnames

	# add some lines below to $home/lib/profile
	# assuming your fs is cwfs64x
	if(! test -e /srv/elnfs)
		kirara/elnfs -fs elnfs /usr
	if(! ns|grep -s elnfs)
		mount -c /srv/elnfs /usr
	cd `{pwd}

(B) How to uninstall Kirara1
	rm -rf $kirara1
	rm $home/bin/rc/^(G1 kfind1)
	rm $home/bin/$objtype/kirara/*
	# you can uninstall Kirara2 likewise

(C) How to create /n/other/kirara1
	mount -c '#s/cwfs' /n/o other
	echo allow >> /srv/cwfs.cmd
	mkdir /n/o/kirara1
	chmod 775 /n/o/kirara1
	echo disallow >> /srv/cwfs.cmd
	unmount /n/o
	# you can create Kirara2 likewise

(D) If your fs is fossil
	# Kirara can be installed anywhere in fossil.
	# Then locate Kirara out of indexing target, and out of daily dump.
	# However your fossil partition might be small (for example 4GB).
	# Then Kirara data can occupy large portion of the fossil partition.
	# Therefore fossil partion can be effectively very small.
	# So it is desirable to install Kirara to kfs.
	# We assume you are already running kfs.
	# The recommended place is /kirara1 in kfs.
	mount -c /srv/kfs /n/kfs
	disk/kfscmd allow
	mkdir /n/kfs/kirara1
	chmod 775 /n/kfs/kirara1
	# then you can see /n/kfs/kirara1
	# you can create Kirara2 likewise
	disk/kfscmd disallow

(E) Tuning
	Kirara's main index file is named "main".
	Large main file will result in slow update.
	Then you can separate your directories: the directories that are updated frequently
	and the directories that are updated not frequently.
	My current configuration is
	term% ls -l /n/other/kirara?/*db/main
	--rw-rw-r-- M 149 arisawa arisawa  69026811 May  7 13:38 /n/other/kirara1/sysdb/main
	--rw-rw-r-- M 149 arisawa arisawa 139636179 Apr 14 18:19 /n/other/kirara1/usr1db/main
	--rw-rw-r-- M 149 arisawa arisawa 122573030 Mar 31 11:04 /n/other/kirara1/usr2db/main
	--rw-rw-r-- M 149 arisawa arisawa 121524974 May  6 20:36 /n/other/kirara1/usrdb/main
	--rw-rw-r-- M 149 arisawa arisawa 135419723 May  7 14:19 /n/other/kirara2/sysdb/main
	--rw-rw-r-- M 149 arisawa arisawa 196557186 Apr 14 19:13 /n/other/kirara2/usr1db/main
	--rw-rw-r-- M 149 arisawa arisawa 279680379 Mar 30 21:21 /n/other/kirara2/usr2db/main
	--rw-rw-r-- M 149 arisawa arisawa 246720704 May  6 19:58 /n/other/kirara2/usrdb/main
	term% 
	mkdbL is provided for the case that we have many usrdbs.
