Sorry, groupadd and useradd don't require an id (and this PKGBUILD wouldn't need to reference it), so you can just exclude the number in the groupadd and useradd commands and not have to worry about it; ie:
groupadd sphinx
useradd -g sphinx -d /usr/share/sphinx/ -s /bin/false sphinx
The process will also need to write to logs and rotate data files, so you'll need to chown the appropriate directories in the install script as well (like the elasticsearch package):
chown -R sphinx:sphinx /var/lib/sphinx/
Search Criteria
Package Details: sphinx 2.2.11-4
Package Actions
Git Clone URL: | https://aur.archlinux.org/sphinx.git (read-only, click to copy) |
---|---|
Package Base: | sphinx |
Description: | Free open-source SQL full-text search engine. |
Upstream URL: | http://www.sphinxsearch.com/ |
Keywords: | devel engine fulltext |
Licenses: | GPL |
Conflicts: | sphinx-beta, sphinx-bin |
Submitter: | None |
Maintainer: | shyamin |
Last Packager: | None |
Votes: | 70 |
Popularity: | 0.173102 |
First Submitted: | 2008-05-26 00:46 (UTC) |
Last Updated: | 2023-10-06 08:30 (UTC) |
Dependencies (5)
- expat (expat-gitAUR)
- libmariadbclient (libmysqlclient55AUR, libmysqlclient56AUR, mariadb-libs-gitAUR, libmysqlclient81AUR, libmysqlclient57AUR, libmysqlclientAUR, libmysqlclient80AUR, mariadb-libs, mariadb-lts-libs)
- postgresql-libs (postgresql-libs-12AUR, postgresql13-libsAUR, postgresql-libs-gitAUR)
- unixodbc (unixodbc-gitAUR)
- postgresql (postgresql-12AUR, postgresql15-docsAUR, postgresql15AUR, postgresql17-docsAUR, postgresql17AUR, postgresql13AUR, postgresql-gitAUR) (optional)
Required by (1)
- symbolator-git (optional)
Sources (5)
Slash commented on 2014-01-17 17:20 (UTC)
Slash commented on 2014-01-17 17:06 (UTC)
@SirPenguins: Nice job on the updates. I think you need to add the actual creation of the user/group in the post-install process. There is no "sphinx" user by default (and the package doesn't create one), so systemd is unable to start the service. Additionally, the tmpfiles.d things won't be applied until you reboot, so the directories won't be created in /run/ after installation.
Check out a package like elasticsearch for an example on how to do these things:
https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/elasticsearch
The elasticsearch.install creates the user, group, and tells systemd to reload the tmpfiles.d configuration after install/update (just make sure you change the user/group id numbers to something else).
SirPenguins commented on 2014-01-02 19:36 (UTC)
Updated and included skunark's changes. Thank you for the help!
skunark commented on 2013-11-10 05:19 (UTC)
Few more recommendations
1) Enable systemd to restart sphinx in the sphinx.service file by adding:
Restart=always
2) Sphinx is running as root and probably should run as created user sphinx, just add in the sphinx.server
User=sphinx
Group=sphinx
3) Sphinx PID file should exist under /run/sphinx, which you can add by create the sphinx.tmpfiles.conf file with the following contents:
d /run/sphinx 0755 sphinx sphinx -
and also update the PKGBUILD with
install -Dm644 "${srcdir}/sphinx.tmpfiles.conf" "${pkgdir}/usr/lib/tmpfiles.d/sphinx.conf"
skunark commented on 2013-09-15 08:21 (UTC)
You might consider adding the following to the PKGBUILD
install -d "${pkgdir}/usr/share/sphinx/lib"
install -Dm644 api/sphinxapi.php "${pkgdir}/usr/share/sphinx/lib/sphinxapi.php"
install -Dm644 api/sphinxapi.py "${pkgdir}/usr/share/sphinx/lib/sphinxapi.py"
benoit commented on 2013-01-04 18:14 (UTC)
Thanks a lot for the fast update!
Systemd does not seem to care if the unit files listed on the After line exist or not (I just tested this).
You could put both dependencies on the After line and it should start both databases, either one of them or none of them depending of whatever is installed. The only drawback I can see with this method is that it will start a useless database if both are installed.
SirPenguins commented on 2013-01-04 14:51 (UTC)
2013-01-04 14:48
Thank you! I updated the package with the new .service file, but I added a new ExecStop directive to use searchd --stopwait to bring down the searchd instance upon a 'systemctl stop sphinx'.
Those using postgresql need to copy the service file to /etc/systemd/system and change the "After" directive to want postgresql instead of mysql. I don't know how to specify an either/or wants for those two.
I've also modified the rc script to use the pid file that upstream recommends and ships their config with.
benoit commented on 2013-01-04 08:36 (UTC)
Below is a systemd service file. This is my first time writing one, but I adapted it from the fedora rpm package, so it should be mostly good.
http://dl.dropbox.com/u/980984/sphinx.service
Pinned Comments
<deleted-account> commented on 2023-09-30 20:51 (UTC)
The last open source version of sphinx was
2.2.11
.2.3.2-beta
has been released, but this is a beta version and should be provided under the namesphinx-beta
. A closed-source version3.5.1
has been released, which should be supported by the maintainers ofsphinx-bin
.