Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation of redis-2.6.7 as a service results in errors #816

Closed
vivekhub opened this issue Dec 7, 2012 · 11 comments
Closed

Installation of redis-2.6.7 as a service results in errors #816

vivekhub opened this issue Dec 7, 2012 · 11 comments

Comments

@vivekhub
Copy link

vivekhub commented Dec 7, 2012

Seems to be there are minor configuration errors. I just did a fresh download and install as a service. I get the following error

vivekv@precise-fan:~/custom-build/redis/redis-2.6.7/utils$ sudo ./install_server.sh 
[sudo] password for vivekv: 
Welcome to the redis service installer
This script will help you easily set up a running redis server


Please select the redis port for this instance: [6379] 
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf] 
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] 
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379] 
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server] 
s#^port [0-9]{4}$#port 6379#;s#^logfile .+$#logfile /var/log/redis_6379.log#;s#^dir .+$#dir /var/lib/redis/6379#;s#^pidfile .+$#pidfile /var/run/redis_6379.pid#;s#^daemonize no$#daemonize yes#;
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
update-rc.d: warning: /etc/init.d/redis_6379 missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/redis_6379 ...
   /etc/rc0.d/K20redis_6379 -> ../init.d/redis_6379
   /etc/rc1.d/K20redis_6379 -> ../init.d/redis_6379
   /etc/rc6.d/K20redis_6379 -> ../init.d/redis_6379
   /etc/rc2.d/S20redis_6379 -> ../init.d/redis_6379
   /etc/rc3.d/S20redis_6379 -> ../init.d/redis_6379
   /etc/rc4.d/S20redis_6379 -> ../init.d/redis_6379
   /etc/rc5.d/S20redis_6379 -> ../init.d/redis_6379
Success!
Starting Redis server...

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 110
>>> 'stop-writes-on-bgsave-error yes'
Bad directive or wrong number of arguments
ERROR: Failed starting service.... Aborting!
@elvin-lian
Copy link

I also have these problem:

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 109

'stop-writes-on-bgsave-error yes'
Bad directive or wrong number of arguments

Who can help me?

@himulawang
Copy link

I have the same problem when I upgrade 2.4.x to 2.6.x.

@vizo
Copy link

vizo commented Jan 11, 2013

Same problem with 2.6.8 ....

@vizo
Copy link

vizo commented Jan 11, 2013

if you use Ubuntu you can try reinstall default package configs by doing this..

apt-get -o DPkg::options::=--force-confmiss --reinstall install redis-server

It works for me :)

@caoxudong
Copy link

My version is 2.6.7

The content between 176 and 183 in install_server.sh:

if [ !`which chkconfig` ] ; then                                                                                                   
    #if we're not a chkconfig box assume we're able to use update-rc.d                                                              
    update-rc.d redis_$REDIS_PORT defaults && echo "Success!"                                                                       
else                                                                                                                                
    # we're chkconfig, so lets add to chkconfig and put in runlevel 345                                                             
    chkconfig --add redis_$REDIS_PORT && echo "Successfully added to chkconfig!"                                                    
    chkconfig --level 345 redis_$REDIS_PORT on && echo "Successfully added to runlevels 345!"                                       
fi                                 

There should be a space after the character '!' in line 176.
e.g.

if [ ! `which chkconfig` ] ; then                                                                                                   
    #if we're not a chkconfig box assume we're able to use update-rc.d                                                              
    update-rc.d redis_$REDIS_PORT defaults && echo "Success!"                                                                       
else                                                                                                                                
    # we're chkconfig, so lets add to chkconfig and put in runlevel 345                                                             
    chkconfig --add redis_$REDIS_PORT && echo "Successfully added to chkconfig!"                                                    
    chkconfig --level 345 redis_$REDIS_PORT on && echo "Successfully added to runlevels 345!"                                       
fi                                 

Please add a space and try again.
Hope this useful.

@vizo
Copy link

vizo commented Jan 11, 2013

Doesn't help for me ....
Maybe i should delete previous config first ..?

@caoxudong
Copy link

@vizo
After executing command "apt-get -o DPkg::options::=--force-confmiss --reinstall install redis-server", do your install-server.sh and configuration file change?
My server is CentOS 5.5. By default, there's nor command 'update-rc.d', so I have to modify install-server.sh, or it will fail.

@vizo
Copy link

vizo commented Jan 11, 2013

Yes i did .. it worked but it installs default config names as port number ... it doesn't accept my values what i enter ... but i run just one instance on one port .. so i prefer to have confg file like redis.conf and service name like redis-server, not
redis_{port}.conf, redis-{port} as service ...

@vizo
Copy link

vizo commented Jan 11, 2013

So on ubuntu i did... and it works...

  • went in src dir
  • make
  • make install
  • deleted old config from /etc/redis/redis.conf (provided with ubuntu of older version, i think 2.4.x)

i tried to copy default redis.conf from tar file but it doesn't work so i did ...

  • run command apt-get -o DPkg::options::=--force-confmiss --reinstall install redis-server

@caoxudong
Copy link

@vizo
Thanks for your detail steps. I'm try to reproduce the error 'Bad directive or wrong number of arguments'.

Besides, because of the character '!' in if condition, install-server will ignore customized configuration.
To modify this, please see this diff

@jimothyGator
Copy link

@caoxudong: I submitted a pull request for the missing space: #909.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants