Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.28 KB | None | 0 0
  1. $ cd /usr/local/search/lucene-search-2/indexes
  2. $ ls -l
  3. total 24
  4. drwxr-xr-x 10 root root 4096 Aug 20 2013 import
  5. drwxr-xr-x 7 root root 4096 Apr 14 06:42 index
  6. drwxr-xr-x 2 root root 4096 Apr 14 06:41 search
  7. drwxr-xr-x 9 root root 4096 Aug 20 2013 snapshot
  8. drwxr-xr-x 2 root root 4096 Aug 20 2013 status
  9. drwxr-xr-x 8 root root 4096 Aug 20 2013 update
  10.  
  11. $ ls -l search/
  12. total 24
  13. lrwxrwxrwx 1 root root 70 Feb 12 21:39 wikidb -> /usr/local/search/lucene-search-2/indexes/update/wikidb/20140212064727
  14. lrwxrwxrwx 1 root root 73 Feb 12 21:39 wikidb.hl -> /usr/local/search/lucene-search-2/indexes/update/wikidb.hl/20140212064727
  15. lrwxrwxrwx 1 root root 76 Apr 14 06:41 wikidb.links -> /usr/local/search/lucene-search-2/indexes/update/wikidb.links/20140414064150
  16. lrwxrwxrwx 1 root root 77 Feb 12 21:39 wikidb.prefix -> /usr/local/search/lucene-search-2/indexes/update/wikidb.prefix/20140212064728
  17. lrwxrwxrwx 1 root root 78 Feb 12 21:39 wikidb.related -> /usr/local/search/lucene-search-2/indexes/update/wikidb.related/20140212064713
  18. lrwxrwxrwx 1 root root 76 Feb 12 21:39 wikidb.spell -> /usr/local/search/lucene-search-2/indexes/update/wikidb.spell/20140212064740
  19.  
  20. #!/bin/sh
  21. log=/var/log/lucene-search-2-cron.log
  22. (
  23. echo "Building wiki lucene-search indexes ..."
  24. cd /usr/local/search/lucene-search-2
  25. ./build
  26.  
  27. echo "Stopping the lsearchd service..."
  28. service lsearchd stop
  29.  
  30. # ok, so stopping the service apparently doesn't mean that the processes are gone, whack them manually
  31. # See tip on using the "[x]yz" character class option so you don't need the additional "grep -v xyz":
  32. # http://stackoverflow.com/questions/3510673/find-and-kill-a-process-in-one-line-using-bash-and-regex
  33. echo "Killing any lucene-search processes that didn't terminate..."
  34. kill -9 $(ps -ef | grep '[l]search' | awk '{print $2}')
  35.  
  36. echo "Starting the lsearchd service..."
  37. service lsearchd start
  38.  
  39. ) > $log 2>&1
  40.  
  41. #!/bin/sh -e
  42. ### BEGIN INIT INFO
  43. # Provides: lsearchd
  44. # Required-Start: $syslog
  45. # Required-Stop: $syslog
  46. # Default-Start: 2 3 4 5
  47. # Default-Stop: 1
  48. # Short-Description: Start the Lucene Search daemon
  49. # Description: Provide a Lucene Search backend for MediaWiki. Copied by John Ericson from: http://ubuntuforums.org/showthread.php?t
  50. =1476445
  51. ### END INIT INFO
  52.  
  53. # Set to install directory of lucense-search. For example: /usr/local/lucene-search-2.1.3
  54. LUCENE_SEARCH_DIR="/usr/local/search/lucene-search-2"
  55.  
  56. # Set username for daemon to run as. Can also use syntax "username:groupname" to also specify group for daemon to run as. For example: me:me
  57. RUN_AS_USER="lsearchd"
  58.  
  59. OPTIONS="-configfile $LUCENE_SEARCH_DIR/lsearch.conf"
  60.  
  61. test -x $LUCENE_SEARCH_DIR/lsearchd || exit 0
  62.  
  63. test -n "$RUN_AS_USER" && CHUID_ARG="--chuid $RUN_AS_USER" || CHUID_ARG=""
  64.  
  65. if [ -f "/etc/default/lsearchd" ] ; then
  66. . /etc/default/lsearchd
  67. fi
  68.  
  69. . /lib/lsb/init-functions
  70.  
  71. case "$1" in
  72. start)
  73. cd $LUCENE_SEARCH_DIR
  74. log_begin_msg "Starting Lucene Search Daemon..."
  75. start-stop-daemon --start --quiet --oknodo --chdir $LUCENE_SEARCH_DIR --background $CHUID_ARG --exec $LUCENE_SEARCH_DIR/lsearchd -- $OPT
  76. IONS
  77. log_end_msg $?
  78. ;;
  79. stop)
  80. log_begin_msg "Stopping Lucene Search Daemon..."
  81. start-stop-daemon --stop --quiet --oknodo --retry 2 --chdir $LUCENE_SEARCH_DIR $CHUID_ARG --exec $LUCENE_SEARCH_DIR/lsearchd
  82. log_end_msg $?
  83. ;;
  84. restart)
  85. $0 stop
  86. sleep 1
  87. $0 start
  88. ;;
  89. reload|force-reload)
  90. log_begin_msg "Reloading Lucene Search Daemon..."
  91. start-stop-daemon --stop -signal 1 --chdir $LUCENE_SEARCH_DIR $CHUID_ARG --exec $LUCENE_SEARCH_DIR/lsearchd
  92. log_end_msg $?
  93. ;;
  94. status)
  95. status_of_proc $LUCENE_SEARCH_DIR/lsearchd lsearchd && exit 0 || exit $?
  96. ;;
  97. *)
  98. log_success_msg "Usage: /etc/init.d/lsearchd {start|stop|restart|reload|force-reload|status}"
  99. exit 1
  100. esac
  101.  
  102. exit 0
  103.  
  104. $ ps -ef | grep [l]search
  105. lsearchd 10192 1 0 14:02 ? 00:00:00 /bin/bash /usr/local/search/lucene-search-2/lsearchd -configfile /usr/local/search/lucene-search-2/lsearch.conf
  106. lsearchd 10198 10192 0 14:02 ? 00:00:01 java -Djava.rmi.server.codebase=file:///usr/local/search/lucene-search-2/LuceneSearch.jar -Djava.rmi.server.hostname=AMWikiBugz -jar /usr/local/search/lucene-search-2/LuceneSearch.jar -configfile /usr/local/search/lucene-search-2/lsearch.conf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement