Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
fix systemd sentinel scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dwerder committed Apr 8, 2016
1 parent 318d2cb commit 2596795
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions manifests/sentinel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
$enabled = true,
$manage_logrotate = true,
) {
$sentinel_user = $::redis::install::redis_user
$sentinel_group = $::redis::install::redis_group

# validate parameters
validate_absolute_path($sentinel_log_dir)
Expand Down
9 changes: 5 additions & 4 deletions templates/systemd/sentinel.service.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[Unit]
Description=Redis Sentinel
Description=Redis Sentinel <%= sentinel_name %>
After=network.target

[Service]
ExecStartPre=/bin/mkdir -p <%= @sentinel_run_dir %>
ExecStartPre=/bin/cp -u <%= @conf_file %> <%= @sentinel_run_dir %>/<%= @conf_file_name %>
ExecStart=/usr/bin/redis-sentinel <%= @sentinel_run_dir %>/<%= @conf_file_name %> --daemonize no
ExecStop=/usr/bin/redis-shutdown redis-sentinel_<%= @sentinel_name %>
User=redis
Group=redis
ExecStop=/usr/bin/redis-cli -p <%= @sentinel_port %> shutdown
User=<%= @sentinel_user or 'root' %>
Group=<%= @sentinel_group or 'root' %>

[Install]
WantedBy=multi-user.target
Expand Down

0 comments on commit 2596795

Please sign in to comment.