gplessis / dotdeb-redis

Dotdeb : Redis
http://www.dotdeb.org/
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Redis starts in foreground after installing redis-sentinel #8

Open sorcix opened 8 years ago

sorcix commented 8 years ago

When installing the redis-sentinel package on Debian Wheezy (7.8) the Redis server starts in the foreground and blocks dpkg.

Packages:

iF  redis-sentinel                     2:3.2.4-1~dotdeb+7.1          amd64        Persistent key-value database with network interface (monitoring)
ii  redis-server                       2:3.2.4-1~dotdeb+7.1          amd64        Persistent key-value database with network interface
ii  redis-tools                        2:3.2.4-1~dotdeb+7.1          amd64        Persistent key-value database with network interface (client)

Process tree:

apt-get---dpkg---redis-sentinel.---invoke-rc.d---redis-sentinel---redis-sentinel---2*[{redis-sentinel}]

Output:

root@high-available-wheezy:~# apt-get install redis-sentinel
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  redis-server redis-tools
Suggested packages:
  ruby-redis
The following NEW packages will be installed:
  redis-sentinel redis-server redis-tools
0 upgraded, 3 newly installed, 0 to remove and 80 not upgraded.
Need to get 0 B/1554 kB of archives.
After this operation, 3592 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_CTYPE = "UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package redis-tools.
(Reading database ... 44136 files and directories currently installed.)
Unpacking redis-tools (from .../redis-tools_2%3a3.2.4-1~dotdeb+7.1_amd64.deb) ...
Selecting previously unselected package redis-server.
Unpacking redis-server (from .../redis-server_2%3a3.2.4-1~dotdeb+7.1_amd64.deb) ...
Selecting previously unselected package redis-sentinel.
Unpacking redis-sentinel (from .../redis-sentinel_2%3a3.2.4-1~dotdeb+7.1_amd64.deb) ...
Processing triggers for man-db ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up redis-tools (2:3.2.4-1~dotdeb+7.1) ...
Setting up redis-server (2:3.2.4-1~dotdeb+7.1) ...
Starting redis-server: redis-server.
Setting up redis-sentinel (2:3.2.4-1~dotdeb+7.1) ...
Starting redis-sentinel: 4389:X 03 Oct 13:55:20.919 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
4389:X 03 Oct 13:55:20.920 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
4389:X 03 Oct 13:55:20.920 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If $ou need higher maxclients increase 'ulimit -n'.
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.2.4 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in sentinel mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 26379
 |    `-._   `._    /     _.-'    |     PID: 4389
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

4389:X 03 Oct 13:55:20.925 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to 
the lower value of 128.
4389:X 03 Oct 13:55:20.928 # Sentinel ID is 466424fd294da569f9d61d361cf97693dcd3ce07
4389:X 03 Oct 13:55:20.928 # +monitor master mymaster 127.0.0.1 6379 quorum 2
vncntvandriessche commented 8 years ago

Can second this behavior. This seems break automatic deployments pipelines.

sorcix commented 8 years ago

The problem seems to be caused by removing daemonize yes from sentinel.conf:

https://github.com/gplessis/dotdeb-redis/commit/457d95327a413ef785880b0f2d5f486326c37ab9#diff-166bca38b3c051922523d48c83fc270cL5

This works on Debian Jessie where SystemD takes care of running things in the background, but breaks on Wheezy as applications are expected to daemonize themselves there.

gplessis commented 7 years ago

Can you please confirm that it's been fixed with the 3.2.5 packages?