solr PID-handling

This commit is contained in:
Micha Glave 2015-05-06 10:14:21 +02:00
parent 2340ffeb01
commit b415e58782
4 changed files with 40 additions and 19 deletions

View File

@ -1,4 +1,4 @@
AUX solr.conf.d 52 SHA256 d2b0c00c29745d186a6f0249c594daf91b52f7785d872b588461e1b1f0e3286b SHA512 25d12ab805c5cc61ccb8d1bbc252fe14b914067b80711326fdcbc7758227531957c3556acf8ff860c65bcf83b44b70386a35f24a6098a0aad76b3532413cab09 WHIRLPOOL a21365d46b72f56c87193261908b8b8b1c86e1686e904b90fc6ee3cbc9be8063d5eacbfc311a7457a70bc9689233f8ec8fd4b9911cf2930499e5fd10ce109bbd AUX solr.conf.d 95 SHA256 b33ae2707ab4ecb24584d8bfce0738021d8c0859440a22a82a9f0cc450590ab7 SHA512 1a4be04de7aec43652fcc57877bcfef287f9010df807bda1a52bd2c13ed31bc61a39302e1820d8f0bd1a2f1e01c9188a669b9bc58b1001b26261ecdeea441f05 WHIRLPOOL 864f790b4c30715a327f014a232bd434cc2b9e6fe8bae748ac7e912a9cfb3abc44138013324c67dc3f296e4c1903480f615b2cb13f58bc313effd3296e4716cc
AUX solr.init.d 359 SHA256 6e97c8c45f15761b589e786f04a74257139ff530211ee5c88b560e399398f1f6 SHA512 0bf93543170602092b7f95f3c265d09963e0e8cf105bdac3b198c0e024405dbb6af5ef157e2009436cc3d4916b2f1c8de77f64856c1f53524da25c350ef35044 WHIRLPOOL 1de81e9f3e7e771f580c63825e425a7ebe1e7a7621e6fab91ed274185a94a9ef362384c978256665808eae3adae55e90a75bb3690c3e215ef4474c5526924395 AUX solr.init.d 524 SHA256 e896799960c182442f6fef4d7088584860a53806692bd1a8e3888d584f8d4b7a SHA512 cfed025f6caf283ebf3c44d6142c83d5045de4bd2ca18fb4cae8c4794fe3ddf24a44fd9ac6cc962c53732b016bd2cb5cf134ff8bf7cc585fd72885816cc7a7f8 WHIRLPOOL aa422e72079bef8d0deee4c1446be9540e47aa34a8fd971ff582a7c0b86f565eb00ccf8dd21f51f074b60a3214a430c4307db9d4b750fa49ca066830aa410765
DIST solr-5.1.0.tgz 131948849 SHA256 8718cbfb789a170d210b0b4adbe4fd8187ecdc67c5348ed9d551578087d8a628 SHA512 24355fa72dbf897877d9d8a41428131b5a551cb917a6d902ee90dde577b22858e1b6be21eb3fd0f79ae55527ee2e2ff64669ced9cbe4d36b73b788215b56e0c8 WHIRLPOOL 32ca30511622405a5ec8ef9645eda05ab49cffa84c6c78096ae4b5c6b3a263655fd8fd6d104a7544d85d24fac0e98101085f6bb6bf10cc88e7e49f047715f68c DIST solr-5.1.0.tgz 131948849 SHA256 8718cbfb789a170d210b0b4adbe4fd8187ecdc67c5348ed9d551578087d8a628 SHA512 24355fa72dbf897877d9d8a41428131b5a551cb917a6d902ee90dde577b22858e1b6be21eb3fd0f79ae55527ee2e2ff64669ced9cbe4d36b73b788215b56e0c8 WHIRLPOOL 32ca30511622405a5ec8ef9645eda05ab49cffa84c6c78096ae4b5c6b3a263655fd8fd6d104a7544d85d24fac0e98101085f6bb6bf10cc88e7e49f047715f68c
EBUILD solr-5.1.0.ebuild 2195 SHA256 706099b78460993b8a3d1fc1d27473c0d8dc8010b1c30b220bb2924809069e66 SHA512 31f6550aa7adc4909d244059d630619d5200b8414a3e696398c8e06716f38598d45cb8e54d9cceed67aa9a42236380a13c736c753fa098368e702b5525620c38 WHIRLPOOL 389309d427daa3536bc8ed54b9d5360a01f8dbbb7f4b22eec1f6d45c1d397d140fdadcd1d3fbd03c3a8208c8ddc7c1e8ac69f6744dca5ba110ad622284937cd9 EBUILD solr-5.1.0.ebuild 2272 SHA256 898774942488aeaf6ffb3f81e93f112cec63cd21107e21c7efa7052643d0b034 SHA512 2f88fe677c256d024dcf7489676648c8935e38576bd241c044cf4b3483712bb0d4cc225e02983fae812bae342f0ff8c0743981892440fa14b52f2142a808fa66 WHIRLPOOL 39a924c2e92c364a526e8d56b4a1c8b54c0f91b71e12fc6993eb307b0e93d35cad00e4829d435756055867f6c42daa9f4cde49b098b2da4ace5b1de3fc4d9933

View File

@ -1,3 +1,7 @@
SOLR_INCLUDE=/var/lib/solr/solr.in.sh SOLR_INCLUDE=/var/lib/solr/solr.in.sh
SOLR_TMPDIR=/var/tmp/solr
SOLR_PORT=8983
SOLR_OPTS="" SOLR_OPTS=""

View File

@ -4,9 +4,12 @@
# $Header: $ # $Header: $
start_stop_daemon_args="-u solr:solr" start_stop_daemon_args="-u solr:solr"
pidfile="/run/solr/solr-${SOLR_PORT:-8983}.pid"
command="/bin/solr" command="/bin/solr"
command_args="start ${SOLR_OPTS}" command_args="start -p ${SOLR_PORT:-8983} ${SOLR_OPTS}"
extra_commands="status"
depend() { depend() {
need net need net
@ -14,7 +17,15 @@ depend() {
} }
start_pre() { start_pre() {
rm -rf /var/tmp/solr rm -rf ${SOLR_TMPDIR}
mkdir /var/tmp/solr mkdir ${SOLR_TMPDIR}
chown solr:solr /var/tmp/solr chown solr:solr ${SOLR_TMPDIR}
}
status() {
/bin/solr status
}
stop() {
/bin/solr stop
} }

View File

@ -32,7 +32,8 @@ pkg_preinst() {
src_prepare() { src_prepare() {
sed_expr="s#solr.log=.*#solr.log=${LOG_DIR}#" sed_expr="s#solr.log=.*#solr.log=${LOG_DIR}#"
sed -i -e "$sed_expr" server/resources/log4j.properties sed -i -e "$sed_expr" server/resources/log4j.properties
echo "SOLR_PID_DIR=$VAR_DIR
echo "SOLR_PID_DIR=/run/${PN}
SOLR_HOME=$VAR_DIR/data SOLR_HOME=$VAR_DIR/data
LOG4J_PROPS=$VAR_DIR/log4j.properties LOG4J_PROPS=$VAR_DIR/log4j.properties
SOLR_LOGS_DIR=$LOG_DIR SOLR_LOGS_DIR=$LOG_DIR
@ -40,13 +41,18 @@ SOLR_LOGS_DIR=$LOG_DIR
sed_vard="s!/var/solr!${VAR_DIR}!" sed_vard="s!/var/solr!${VAR_DIR}!"
sed_usrd="s!/usr/share/solr!${INSTALL_DIR}!" sed_usrd="s!/usr/share/solr!${INSTALL_DIR}!"
sed_pidd="s!SOLR_PID_DIR=\"$SOLR_TIP/bin\"!SOLR_PID_DIR=\"/run/${PN}\"!" # PID-dir into /run/solr/
sed -i -e "$sed_vard" -e "$sed_usrd" -e "$sed_pidd" bin/solr bin/post sed_pidd="s!SOLR_PID_DIR=\"\$SOLR_TIP/bin\"!SOLR_PID_DIR=\"/run/${PN}\"!"
# replace linkname in script
sed_post="s!\(echo \".*\)\$THIS_SCRIPT!\1solr_post!"
sed -i -e "$sed_vard" -e "$sed_usrd" -e "$sed_pidd" -e "$sed_post" bin/solr bin/post
# Temp-Dir to /var/tmp/solr # Temp-Dir to /var/tmp/solr
# <Set name="tempDirectory"><Property name="jetty.home" default="."/>/solr-webapp</Set> # <Set name="tempDirectory"><Property name="jetty.home" default="."/>/solr-webapp</Set>
sed_tmpd="s!\(<Set name=\"tempDirectory\">\).*\(</Set>\)!\1/var/tmp/solr\2!" sed_tmpd="s!\(<Set name=\"tempDirectory\">\).*\(</Set>\)!\1/var/tmp/solr\2!"
sed -i -e "$sed_tmpd" server/contexts/solr-jetty-context.xml sed -i -e "$sed_tmpd" server/contexts/solr-jetty-context.xml
rmdir server/logs server/solr-webapp
} }
src_install() { src_install() {