reopen 656326
No cron changes or permission changes on the pid occurred. I've attached the
diff in the attached patch. I also enhanced the variable escaping.
--
--
Daniel Black, Engineer @ Open Query (http://openquery.com)
Remote expertise & maintenance for MySQL/MariaDB server environments.
--- init.d 2012-04-20 12:29:32.000000000 +1000
+++ init.d.new 2012-04-21 12:50:10.677176244 +1000
@@ -78,7 +78,7 @@
[ ! -f "$PIDFILE" ] && return 1
# Obtain the pid and check it against the binary name
pid=`cat $PIDFILE`
- running_pid $pid $DAEMON || return 1
+ running_pid "${pid}" "${DAEMON}" || return 1
return 0
}
@@ -98,7 +98,7 @@
fi
fi
fi
- rm -f $PIDFILE
+ rm -f "${PIDFILE}"
return 0
}
do_start() {
@@ -110,18 +110,20 @@
exit 1
fi
- start-stop-daemon --start --pidfile $PIDFILE --chuid sphinxsearch --exec ${DAEMON}
+ start-stop-daemon --start --pidfile "$PIDFILE" --chuid sphinxsearch --exec "${DAEMON}"
+ chgrp sphinxsearch "$PIDFILE"
+ chmod g+r "$PIDFILE"
}
do_stop() {
- start-stop-daemon --stop --quiet --oknodo --user sphinxsearch --pidfile $PIDFILE \
- --exec $DAEMON
+ start-stop-daemon --stop --quiet --oknodo --user sphinxsearch --pidfile "${PIDFILE}" \
+ --exec "${DAEMON}"
}
case "$1" in
start)
echo -n "Starting $DESC: "
do_start
- [ -n "$STARTDELAY" ] && sleep $STARTDELAY
+ [ -n "$STARTDELAY" ] && sleep "${STARTDELAY}"
if running ; then
echo "$NAME."
@@ -146,7 +148,7 @@
restart|reload|force-reload)
echo -n "Restarting $DESC: "
do_stop
- [ -n "$DODTIME" ] && sleep $DODTIME
+ [ -n "$DODTIME" ] && sleep "${DODTIME}"
do_start
echo "$NAME."
;;
--- cron.d 2011-04-09 18:12:43.000000000 +1000
+++ cron.d.new 2012-04-21 12:52:40.859381472 +1000
@@ -1,6 +1,6 @@
# Rebuild all indexes daily and notify searchd.
-@daily root . /etc/default/sphinxsearch && if [ "$START" = "yes" ] && [ -x /usr/bin/indexer ]; then /usr/bin/indexer --quiet --rotate --all; fi
+@daily sphinxsearch . /etc/default/sphinxsearch && if [ "$START" = "yes" ] && [ -x /usr/bin/indexer ]; then /usr/bin/indexer --quiet --rotate --all; fi
# Example for rotating only specific indexes (usually these would be part of
# a larger combined index).