Hello,
In my Ubuntu server I can see 2 services. manticore and manticore.service.
It says manticore is stand alone. Is there one that I am supposed to use vs the other? manticore.service seems to work fine for me.
Thanks,
Laurent
Hello,
In my Ubuntu server I can see 2 services. manticore and manticore.service.
It says manticore is stand alone. Is there one that I am supposed to use vs the other? manticore.service seems to work fine for me.
Thanks,
Laurent
How do I reproduce this? Here’s what I see in Ubuntu Jammy:
root@810693a16158:/# systemctl list-units --type=service --all|grep manticore
manticore.service loaded active running Manticore Search Engine
root@810693a16158:/#
Yes me too! I noticed the stand alone didn’t work fully for me.
Here is my manticore (Fast standalone full-text SQL search engine):
#! /bin/sh
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Further changes by Javier Fernandez-Sanguino <jfs@debian.org>
# Modified for sphinx by Radu Spineanu <radu@debian.org>
# Modified by Anton Tsitlionok <deogar@sphinxsearch.com>, 2013
#
#
### BEGIN INIT INFO
# Provides: manticore
# Required-Start: $local_fs $remote_fs $syslog $network $time
# Required-Stop: $local_fs $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Fast standalone full-text SQL search engine
### END INIT INFO
. /lib/lsb/init-functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/searchd
DAEMONOPTS='-c /etc/manticoresearch/manticore.conf'
NAME=manticore
DESC=manticore
test -x $DAEMON || exit 0
LOGDIR=${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/manticore
PIDFILE=/var/run/manticore/searchd.pid
DODTIME=1 # Time to wait for the server to die, in seconds
# If this value is set too low you might not
# let some servers to die gracefully and
# 'restart' will not work
STARTDELAY=0.5
# Include manticore defaults if available
if [ -f /etc/default/manticore ] ; then
. /etc/default/manticore
fi
if [ "$START" != "yes" ]; then
echo "To enable $NAME, edit /etc/default/manticore and set START=yes"
exit 0
fi
set -e
running_pid()
{
# Check if a given process pid's cmdline matches a given name
pid=$1
name=$2
[ -z "$pid" ] && return 1
[ ! -d /proc/$pid ] && return 1
cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
# Is this the expected child?
[ "$cmd" != "$name" ] && return 1
return 0
}
running()
{
# Check if the process is running looking at /proc
# (works for all users)
# No pidfile, probably no daemon present
[ ! -f "$PIDFILE" ] && return 1
# Obtain the pid and check it against the binary name
pid=`cat $PIDFILE`
running_pid $pid $DAEMON || return 1
return 0
}
do_force_stop() {
# Forcefully kill the process
[ ! -f "$PIDFILE" ] && return
if running ; then
kill -15 $pid
# Is it really dead?
[ -n "$DODTIME" ] && sleep "$DODTIME"s
if running ; then
kill -9 $pid
[ -n "$DODTIME" ] && sleep "$DODTIME"s
if running ; then
echo "Cannot kill $NAME (pid=$pid)!"
exit 1
fi
fi
fi
rm -f $PIDFILE
return 0
}
do_start() {
test -e /var/run/manticore || install -m 755 -o root -d root /var/run/manticore
# Check if we have the configuration file
if [ ! -f /etc/manticoresearch/manticore.conf ]; then
echo "\n"
echo "Please create an /etc/manticoresearch/manticore.conf configuration file."
echo "A template is provided as /etc/manticoresearch/manticore.conf.sample."
exit 1
fi
start-stop-daemon --start --pidfile $PIDFILE --exec ${DAEMON} -- ${DAEMONOPTS}
}
do_stop() {
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
--exec $DAEMON -- ${DAEMONOPTS}
}
case "$1" in
start)
echo -n "Starting $DESC: "
do_start
[ -n "$STARTDELAY" ] && sleep $STARTDELAY
if running ; then
echo "$NAME is started."
else
echo " ERROR."
fi
;;
stop)
echo -n "Stopping $DESC: "
if running ; then
do_stop
echo "stopped."
else
echo "already stopped."
fi
;;
force-stop)
if running ; then
echo -n "Forcefully stopping $DESC: "
do_force_stop
echo "stopped."
else
echo -n "$NAME is already stopped. Forcing: "
do_force_stop
echo "stopped."
fi
;;
restart|reload|force-reload)
echo -n "Restarting $DESC: "
do_stop
[ -n "$DODTIME" ] && sleep $DODTIME
do_start
echo "$NAME is restarted."
;;
status)
echo -n "$NAME is "
if running ; then
echo "running."
else
echo "not running."
exit 1
fi
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
exit 1
;;
esac
exit 0
Now here is manticore.service (Manticore Search Engine):
[Unit]
Description=Manticore Search Engine
After=network.target remote-fs.target nss-lookup.target
Documentation=https://manual.manticoresearch.com/, man:searchd(1)
[Service]
Type=forking
User=manticore
Group=manticore
# Run ExecStartPre with root-permissions
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/run/manticore
ExecStartPre=/bin/chown manticore.manticore /var/run/manticore
# Run ExecStart with User=manticore / Group=manticore
ExecStart=/usr/bin/searchd --config /etc/manticoresearch/manticore.conf
ExecStop=/usr/bin/searchd --config /etc/manticoresearch/manticore.conf --stopwait
KillMode=process
KillSignal=SIGTERM
SendSIGKILL=no
LimitNOFILE=65536
LimitCORE=infinity
LimitMEMLOCK=infinity
Restart=on-failure
TimeoutStartSec=infinity
PIDFile=/var/run/manticore/searchd.pid
[Install]
WantedBy=multi-user.target
Alias=manticore.service
Alias=searchd.service
Here is my manticore (Fast standalone full-text SQL search engine):
It looks like an old Sphinx init script which you get when you do apt install sphinxsearch
in Debian Buster and then adapt it to Manticore. Is it the case? If so, why did you do it if Manticore comes with its own systemd unit? If not, where did you get the package which provides this file?