added an rc script for searchd

This commit is contained in:
SJ 2012-02-15 10:21:57 +01:00
parent 019446eebe
commit 1e7039c433
3 changed files with 53 additions and 23 deletions

23
README
View File

@ -13,7 +13,7 @@ Features:
- digital fingerprinting and verification
- full text search
- simple and advanced search
- simple, advanced and expert search
- save search criteria
- tagging emails
- view, export, restore emails
@ -34,24 +34,3 @@ Features:
- recognised formats: PST, EML, Maildir, mailbox
locales under debian: dpkg-reconfigure locales
init:
indexer --all
searchd inditasa
indexer delta1 --rotate
indexer --merge main1 delta1 --rotate --merge-dst-range deleted 0 0
Enron dataset: http://www.cs.cmu.edu/~enron/

View File

@ -24,12 +24,13 @@ INSTALL = @INSTALL@
all:
sed -e "s%SBINDIR%$(sbindir)%" -e "s%SYSCONFDIR%$(sysconfdir)%" $(srcdir)/rc.piler.in > $(srcdir)/rc.piler
sed -e "s%BINDIR%$(bindir)%" -e "s%SYSCONFDIR%$(sysconfdir)%" $(srcdir)/rc.searchd.in > $(srcdir)/rc.searchd
install:
clean:
rm -f rc.piler
rm -f rc.piler rc.searchd
distclean: clean
rm -f Makefile

50
init.d/rc.searchd.in Normal file
View File

@ -0,0 +1,50 @@
#!/bin/sh
##
##
NAME=searchd
PID_FILE=/var/piler/sphinx/searchd.pid
PID_NUMBER=`test -f ${PID_FILE} && cat ${PID_FILE}`
start() {
echo "starting searchd . . ."
su piler -c 'BINDIR/searchd'
}
stop() {
echo "stopping searchd"
killall ${NAME}
}
check_status(){
test -f /proc/${PID_NUMBER}/status
}
case "$1" in
start)
start;
;;
stop)
stop;
;;
status)
if check_status;
then
echo "${NAME} is running."
else
echo "${NAME} is not running."
fi
;;
restart)
stop;
sleep 1;
start;
;;
*)
echo "Usage: $0 start|stop|restart|status"
esac