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

redis installation on ubuntu 22.04 fails because /var/run/redis directory doesn't exists. #457

Open
fidalcastro opened this issue Dec 2, 2022 · 0 comments

Comments

@fidalcastro
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet:
    • Server: 7.9.2
    • Agent: 7.20.0
  • Ruby:
  • Distribution: Ubuntu 22.04.1 LTS
  • Module version: v8.5.0

How to reproduce (e.g Puppet code you use)

Running below code on ubuntu 22.04 which installs the redis-server & redis-tools using ppa package but fails to start the redis.service(systemd).

Error is unable to create redis.sock because directory /var/run/redis is not available. If I create this directory manually & changes, its ownershipt to redis:redis then it works.

class { '::redis':
    bind                     => '0.0.0.0',
    daemonize          => false,
    databases           => 16,
    manage_repo      => true,
    maxclients           => 4000,
    package_ensure  => $package_ensure,
    port                      => 6379,
    ppa_repo             => 'ppa:redislabs/redis',
    protected_mode  => false,
    syslog_enabled   => true,
    syslog_facility      => 'local0',
    timeout                => 0,
  }

What are you seeing

Installs the required version of redis-server but fails to start the service because of missing /var/run/redis

What behaviour did you expect instead

Directory /var/run/redis should be created as part of config.pp

Output log

root@redis-server-02:~# sudo systemctl status redis-server
× redis-server.service - Redis Advanced key-value store for instance default
     Loaded: loaded (/etc/systemd/system/redis-server.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2022-12-02 11:42:43 UTC; 3min 10s ago
    Process: 1379 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf --supervised systemd --daemonize no (code=exited, status=1/FAILURE)
   Main PID: 1379 (code=exited, status=1/FAILURE)
     Status: "Redis is loading..."
        CPU: 11ms

Dec 02 11:42:43 redis-server-02 systemd[1]: redis-server.service: Main process exited, code=exited, status=1/FAILURE
Dec 02 11:42:43 redis-server-02 systemd[1]: redis-server.service: Failed with result 'exit-code'.
Dec 02 11:42:43 redis-server-02 systemd[1]: Failed to start Redis Advanced key-value store for instance default.
Dec 02 11:42:43 redis-server-02 systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 5.
Dec 02 11:42:43 redis-server-02 systemd[1]: Stopped Redis Advanced key-value store for instance default.
Dec 02 11:42:43 redis-server-02 systemd[1]: redis-server.service: Start request repeated too quickly.
Dec 02 11:42:43 redis-server-02 systemd[1]: redis-server.service: Failed with result 'exit-code'.
Dec 02 11:42:43 redis-server-02 systemd[1]: Failed to start Redis Advanced key-value store for instance default.
root@redis-server-02:~#
root@redis-server-02:~#
root@redis-server-02:~#
root@redis-server-02:~# tail -10f /var/log/redis/redis-server.log
42258:M 02 Dec 2022 11:41:07.998 # Warning: Could not create server TCP listening socket ::1:6379: bind: Cannot assign requested address
42258:M 02 Dec 2022 11:41:07.999 * Running mode=standalone, port=6379.
42258:M 02 Dec 2022 11:41:07.999 # Server initialized
42258:M 02 Dec 2022 11:41:07.999 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
42258:M 02 Dec 2022 11:41:07.999 * Ready to accept connections
42258:M 02 Dec 2022 11:41:22.475 # User requested shutdown...
42258:M 02 Dec 2022 11:41:22.475 * Saving the final RDB snapshot before exiting.
42258:M 02 Dec 2022 11:41:22.480 * DB saved on disk
42258:M 02 Dec 2022 11:41:22.480 * Removing the pid file.
42258:M 02 Dec 2022 11:41:22.480 # Redis is now ready to exit, bye bye...
^C
root@redis-server-02:~#
root@redis-server-02:~#
root@redis-server-02:~#
root@redis-server-02:~# tail -10f /var/log/redis/redis.log
1378:C 02 Dec 2022 11:42:43.029 # Redis version=7.0.5, bits=64, commit=00000000, modified=0, pid=1378, just started
1378:C 02 Dec 2022 11:42:43.029 # Configuration loaded
1378:M 02 Dec 2022 11:42:43.030 * monotonic clock: POSIX clock_gettime
1378:M 02 Dec 2022 11:42:43.030 # Failed opening Unix socket: bind: No such file or directory
1379:C 02 Dec 2022 11:42:43.271 * Supervised by systemd. Please make sure you set appropriate values for TimeoutStartSec and TimeoutStopSec in your service unit.
1379:C 02 Dec 2022 11:42:43.272 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1379:C 02 Dec 2022 11:42:43.272 # Redis version=7.0.5, bits=64, commit=00000000, modified=0, pid=1379, just started
1379:C 02 Dec 2022 11:42:43.272 # Configuration loaded
1379:M 02 Dec 2022 11:42:43.273 * monotonic clock: POSIX clock_gettime
1379:M 02 Dec 2022 11:42:43.273 # Failed opening Unix socket: bind: No such file or directory

Any additional information you'd like to impart

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

1 participant