我正在逐行遵循本教程: https://docs.meilisearch.com/learn/cookbooks/running_product.html#step-4-run-meilisearch-as-a-service
它有一个使用此配置将 Meilisearch 设置为服务的步骤:
cat << EOF > /etc/systemd/system/meilisearch.service
[Unit]
Description=Meilisearch
After=systemd-user-sessions.service
[Service]
Type=simple
WorkingDirectory=/var/lib/meilisearch
ExecStart=/usr/local/bin/meilisearch --config-file-path /etc/meilisearch.toml
User=meilisearch
Group=meilisearch
[Install]
WantedBy=multi-user.target
EOF
但是,当我按照建议运行它时,出现此错误:
systemd[1]: Started Meilisearch.
systemd[2834]: meilisearch.service: Failed to execute command: Permission denied
systemd[2834]: meilisearch.service: Failed at step EXEC spawning /usr/local/bin/meilise
systemd[1]: meilisearch.service: Main process exited, code=exited, status=203/EXEC
systemd[1]: meilisearch.service: Failed with result 'exit-code'.
但是,当我运行服务配置中指定的命令时,它运行良好:
/usr/local/bin/meilisearch --config-file-path /etc/meilisearch.toml
这是在 Debian 10 和 Debian 11 上。