<commit_before>description "redis server (<%= @name %>)"

start on runlevel [23]
stop on shutdown

# Does not work at the moment, see below.
# <%- if @user && @group %>
# setuid <%= @user %>
# setgid <%= @group %>
# <%- end %>

expect fork

<%= 'respawn' if @respawn %>

# Does not work with setuid stanza!
# See: https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/911207
pre-start script
  mkdir -p /var/run/redis
  <%- if @user && @group %>
  chown -R <%= @user %>:<%= @group %> /var/run/redis
  <%- end %>
end script

post-stop script
  rm -rf /var/run/redis/redis_<%= @port %>.pid
end script

#exec /usr/local/bin/redis-server /etc/redis/<%= @port %>.conf

exec start-stop-daemon --start -c <%= @user %> --exec /usr/local/bin/redis-server /etc/redis/<%= @port %>.conf<commit_msg>Fix start of redis instance via upstart.<commit_after>description "redis server (<%= @name %>)"

start on runlevel [23]
stop on shutdown

# Does not work at the moment, see below.
# <%- if @user && @group %>
# setuid <%= @user %>
# setgid <%= @group %>
# <%- end %>

expect fork

<%= 'respawn' if @respawn %>

# Does not work with setuid stanza!
# See: https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/911207
pre-start script
  mkdir -p /var/run/redis
  <%- if @user && @group %>
  chown -R <%= @user %>:<%= @group %> /var/run/redis
  <%- end %>
end script

post-stop script
  rm -rf /var/run/redis/redis_<%= @port %>.pid
end script

#exec /usr/local/bin/redis-server /etc/redis/<%= @port %>.conf

exec start-stop-daemon --start -c <%= @user %> -p /var/run/redis/redis_<%= @port %>.pid --exec /usr/local/bin/redis-server /etc/redis/<%= @port %>.conf
{'fraction_non_alphanumeric': 0.20889159561510354, 'fraction_numerical': 0.0097442143727162, 'mean_word_length': 3.3010471204188483, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1200264', 'n_tokens_mistral': 704, 'n_tokens_neox': 616, 'n_words': 169}