The init script still has "--make-pidfile" in start-stop-daemon options which needs to be removed so that it all works properly --- /etc/init.d/redis.orig 2015-03-02 02:02:08.932216945 +0100 +++ /etc/init.d/redis 2015-03-02 02:02:15.856144670 +0100 @@ -10,7 +10,7 @@ command=/usr/sbin/redis-server pidfile=${REDIS_PID:-/run/redis/redis.pid} -start_stop_daemon_args="--background --make-pidfile --pidfile ${pidfile} +start_stop_daemon_args="--background --pidfile ${pidfile} --chdir \"${REDIS_DIR}\" --user ${REDIS_USER} --group ${REDIS_GROUP}" command_args="${REDIS_OPTS}" If you want, I fill fix it in tree
Just verified that redis does indeed create it. Looks good, feel free to commit ( to 2.8.19, right?). Thanks!
Done. Please keep in mind that this also affects current stable ebuild. so what should we do about it? IMO it can be fixed, too. What do you think?
Mh, for me the runscript doesn't work (yes, I have the current version: # $Header: /var/cvsroot/gentoo-x86/dev-db/redis/files/redis.initd-4,v 1.3 2015/03/07 03:21:25 mschiff Exp $): # pgrep redis (nothing) # /etc/init.d/redis status * status: stopped # /etc/init.d/redis start * Caching service dependencies ... [ ok ] * Starting redis ... [ ok ] # /etc/init.d/redis status * status: crashed # pgrep redis 9939 # ls -l /run/redis/ total 0 srwxrwx--- 1 redis redis 0 Mar 9 02:24 redis.sock # grep -A 3 "pid file" /etc/conf.d/redis # Redis pid file. # (Be sure to change the main redis configuration file as well if you change # this from the default.) REDIS_PID="/run/redis/redis.pid" # grep -B 1 -A 1 "pid file" /etc/redis.conf # By default Redis does not run as a daemon. Use 'yes' if you need it. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. daemonize no # When running daemonized, Redis writes a pid file in /var/run/redis.pid by # default. You can specify a custom pid file location here. pidfile /run/redis/redis.pid For me, you did exactly the wrong thing: With the latest updated, daemonize no seems to be the new default. But in this mode, redis won't write any pid file. So we *need* "--make-pidfile" option for start-stop-daemon. I am suggesting # diff -u /etc/init.d/redis.old /etc/init.d/redis --- /etc/init.d/redis.old 2015-03-09 02:27:55.916271930 +0100 +++ /etc/init.d/redis 2015-03-09 02:36:30.083512506 +0100 @@ -6,11 +6,11 @@ REDIS_OPTS=${REDIS_OPTS:-"${REDIS_CONF}"} REDIS_USER=${REDIS_USER:-redis} REDIS_GROUP=${REDIS_GROUP:-redis} -REDIS_TIMEOUT=${REDIS_TIMEOUT:-30} command=/usr/sbin/redis-server pidfile=${REDIS_PID:-/run/redis/redis.pid} -start_stop_daemon_args="--background --pidfile ${pidfile} +retry=${REDIS_TIMEOUT:-"TERM/30/KILL/5"} +start_stop_daemon_args="--make-pidfile --background --pidfile ${pidfile} --chdir \"${REDIS_DIR}\" --user ${REDIS_USER} --group ${REDIS_GROUP}" command_args="${REDIS_OPTS}" @@ -22,12 +22,3 @@ start_pre() { checkpath -d -m 0775 -o ${REDIS_USER}:${REDIS_GROUP} $(dirname ${REDIS_PID}) } - -stop() { - ebegin "Stopping ${SVCNAME}" - start-stop-daemon --stop \ - --exec ${command} \ - --retry ${REDIS_TIMEOUT} \ - --pidfile ${pidfile} - eend -}
If upstream defaults to "daemonize no" then I'd suggest reverting my change.
Just to clarify: daemonize no is upstream's default. Gentoo was patching the default config (last version with "daemonize yes": dev-db/redis-2.8.13). To fix bug 529050, Gentoo added a new config patch which keeps upsteam's "daemonize no" (because systemd likes that). Now the question is, why you (Marc) suggest to "fix" (=undo) the runscript. Mistake? I.e. didn't you run "etc-update" so you didn't noticed "daemonize" changed? If there's no valid reason, please revert your changes.
The reason I've stayed off of this is because I have no systemd installed. It's just hard to verify those environments working (and therefore deciding what the "sane" default should be). All I know is that previous to systemd, it was working as intended. Sorry for not being a lot of help here :-/
Hi. I think the initscript is still broken. Just installed 2.8.19-r1. There is no pidfile created. In redis.conf the setting is: "deamonize no". That's fine but you have to create the pidfile with the initscript then i guess. But the option --make-pidfile is missing. cheers t.
Thanks to all for reporting back. I reverted the change. Should be OK now. Closing.