Scenario / Questions
I keep my sphinx pid in /var/run/sphinx/searchd.pid but every time I hard reboot the directory /var/run/sphinx disappears and sphinx fails to start. Is there a way to make that directory stick or have it automatically created? How do people usually handle this situation? I use Ubuntu Hardy
Find below all possible solutions or suggestions for the above questions..
That directory is ephemeral by design. If its contents stuck around across boots, all sorts of ugly effects could occur, as control scripts of various sorts look in there to see what processes they should be signaling. On recent system, this temporary nature is enforced by mounting
tmpfs, while older systems just deleted everything in the directory at startup.
Therefore, you need to configure Sphinx or its startup script to create that directory, or just write the PID file in
You have two chances at least:
- change your init script to do a
mkdir -p /var/run/sphinx/
pid_file = /var/run/sphinx-searchd.pidin
I’m for the second one.
there is now a centralized mechanism for the creation of temporary files and directories such as these. A service wishing to use this method can remove mkdir commands in its own startup script and instead place a .conf file in /etc/tmpfiles.d, /run/tmpfiles.d, or /usr/lib/tmpfiles.d, with Ubuntu services seeming to prefer the last option.
for your case create a file
the content of the file would be:
d /var/run/sphinx 0755 root root
d stands for directory, next to it is the path, permission, owner and group.
This will create the
/var/run/sphnix directory on reboot.
Checkout the full documentation tmpfiles.d
Kubernetes Free Online Tutorial, Kubernetes Beginner Tutorial
DevOps Free Online Tutorial, DevOps Beginner Tutorial
Ansible Free Online Tutorial, Ansible Beginner Tutorial
Docker Free Online Tutorial, Docker Beginner Tutorial
Openstack Free Online Tutorial, Openstack Beginner Tutorial
Disclaimer: This has been sourced from a third party syndicated feed through internet. We are not responsibility or liability for its dependability, trustworthiness, reliability and data of the text. We reserves the sole right to alter, delete or remove (without notice) the content in its absolute discretion for any reason whatsoever.