2017-07-08 15 views
0

如何在searchd.service上添加多個conf文件,以便服務器重新啓動或重新啓動時自動加載conf?現在的問題是隻有1的conf獅身人面像searchd.service多個conf文件

[Unit] 
Description=SphinxSearch Search Engine 
After=network.target remote-fs.target nss-lookup.target 
After=syslog.target 

[Service] 
Type=forking 
User=sphinx 
Group=sphinx 
# Run ExecStartPre with root-permissions 
PermissionsStartOnly=true 
ExecStartPre=/bin/mkdir -p /var/run/sphinx 
ExecStartPre=/bin/chown sphinx.sphinx /var/run/sphinx 
# Run ExecStart with User=sphinx/Group=sphinx 
ExecStart=/usr/bin/searchd --config /home/www/websites/_sphinx/web1/web1.conf 
KillMode=process 
KillSignal=SIGTERM 
SendSIGKILL=no 
LimitNOFILE=infinity 
PIDFile=/home/www/websites/_sphinx/web1/log/searchd.pid 

[Install] 
WantedBy=multi-user.target 
Alias=sphinx.service 
Alias=sphinxsearch.service 

進出口使用在CentOS 7.3

斯芬克斯獅身人面像的版本,2.2.11-1.rhel7.x86_64.rpm

回答

1

目前獅身人面像不支持多個配置文件或include指令。

但是你可以使用一種解決方法:如果一個配置文件以像#!/bin/sh這樣的shebang開頭,那麼Sphinx將啓動指定的解釋器並將其輸出作爲配置信息讀取。

所以,你可以使用這個:

#!/bin/sh 
cat /path_to_sphinx_conf_files/*.conf 

只要確保你的配置文件都以正確的順序命名的,如果他們互相依賴。