Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add some improvements to init script. #964

Open
wants to merge 1 commit into from

2 participants

@marcelaraujo

Added restart support.

@moreaki

While your additions are well-intended, I believe that in the current state of affairs they will not be propagated to the final boot control scripts upon installation. Check the utils/install_server.sh script in the sources, which basically compiles the final init script. I think a more intended patch could look like follows:

--- a/utils/install_server.sh
+++ b/utils/install_server.sh
@@ -136,6 +136,7 @@ rm -f $TMP_FILE
 REDIS_INIT_HEADER=\
 "#/bin/sh\n
 #Configurations injected by install_server below....\n\n
+. /etc/rc.d/init.d/function\n\n
 EXEC=$REDIS_EXECUTABLE\n
 CLIEXEC=$CLI_EXEC\n
 PIDFILE=$PIDFILE\n

Who is responsable for applying patches?

I gonna change it because on Red Hat/Fedora/CentOS systems, the init script doesn't works and it can be added to boot initialization without init.d functions.

https://github.com/antirez (@antirez) is the main responsible person for applying changes, however he's a busy chap and init script changes most probably are not very high up his todo list. I just add some comments here and there to facilitate his decision making in either applying the patch or dropping it all together and closing the issue; sort of a backlog reduction facilitator.

On a sidenote: as you can see, your patch has been superseed by more complete cleanup, which I have referenced somewhere.

@moreaki

This looks just fine, although I wonder if the sleep time should be a settable parameter?

@moreaki moreaki referenced this pull request from a commit in melvyn-sopacua/redis
@melvyn-sopacua melvyn-sopacua Add restart command
While in here, make sure the provides: line is correct.
ac3c44a
@moreaki

Hmm, the set of cleanups proposed in might be favourable to this pull request: #1066. The restart has been implemented here: melvyn-sopacua@ac3c44a

@JackieXie168 JackieXie168 referenced this pull request from a commit
@jdoliner jdoliner Fixes many cases of scoping values w/o types.
This is a problem that right now needs to be fixed by hand and it's
really stupid. In the future we'll have a structure which enforces this.

Fixes #964.
41583d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 24, 2013
  1. Add some improvements to init script.

    Marcel Araujo authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +2 −0  utils/redis_init_script
  2. +5 −0 utils/redis_init_script.tpl
View
2  utils/redis_init_script
@@ -3,6 +3,8 @@
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.
+. /etc/rc.d/init.d/functions
+
REDISPORT=6379
EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli
View
5 utils/redis_init_script.tpl
@@ -9,6 +9,11 @@ case "$1" in
$EXEC $CONF
fi
;;
+ restart)
+ stop
+ sleep 5
+ start
+ ;;
stop)
if [ ! -f $PIDFILE ]
then
Something went wrong with that request. Please try again.