Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 像守护进程一样运行solr_Bash_Solr_Init.d - Fatal编程技术网

Bash 像守护进程一样运行solr

Bash 像守护进程一样运行solr,bash,solr,init.d,Bash,Solr,Init.d,我试图使solr作为/etc/init.d/solr中的启动脚本运行。 这是我从中复制粘贴的脚本 我做了上面链接中描述的一切。但是我犯了一个错误 service solr start Starting solr.../etc/init.d/solr: Usage: daemon [+/-nicelevel] {program} failed. See error code for more information. 阅读本文时,我不明白为什么守护进程写得不正确,因为自2010年(脚本发布时)起

我试图使solr作为/etc/init.d/solr中的启动脚本运行。 这是我从中复制粘贴的脚本

我做了上面链接中描述的一切。但是我犯了一个错误

service solr start
Starting solr.../etc/init.d/solr: Usage: daemon [+/-nicelevel] {program}
failed. See error code for more information.

阅读本文时,我不明白为什么守护进程写得不正确,因为自2010年(脚本发布时)起,
守护进程的函数(来自
/etc/init.d/functions
)发生了更改,不再接受相同的参数,所以这不起作用。您需要重写
守护进程
行以接受当前支持的参数

我在CentOS 6机器上查看了
守护进程
函数,看起来您可以替换这一行:

daemon --chdir='/usr/local/solr/example' --command "java -jar start.jar" --respawn --output=/var/log/solr/solr.log --name=solr --verbose
仅此而已:

daemon "java -jar /usr/local/solr/example/start.jar"
(假设
solr
安装在
/usr/local/solr/example
中)

daemon "java -jar /usr/local/solr/example/start.jar"