Page MenuHomeDevCentral

NetBox outage on WindRiver restart
Open, Needs TriagePublic

Description

Redis not started on startup

Cannot 'start' redis. Set redis_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.

Should be done with salt

Related Objects

Event Timeline

dereckson renamed this task from netbox outage on windriver restart to NetBox outage on WindRiver restart.Jan 16 2024, 22:39
dereckson updated the task description. (Show Details)

That requires two steps:

  • Enable and configure the service in /etc/rc/
  • Start the service

Configuration options should be in /usr/local/etc/rc.d/redis.

An example of how it's done for Vault:

Adapted from roles/vault/vault/init.sls
#   -------------------------------------------------------------
#   Service
#   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

{% if grains["os"] == "FreeBSD" %}
/etc/rc.conf.d/vault:
  file.managed:
    - makedirs: True
    - mode: 644
    - contents: |
        vault_enable="YES"
        vault_syslog_output_enable="YES"
{% endif %}

service_vault:
  service.running:
    - name: vault
    - enable: True

The service configuration file needs to be:

  • /etc/rc.conf.d/<service> if one configuration file is enough
  • /etc/rc.conf.d/<service>/<any name> if more than one configuration file needs to exist, ie if different Salt states need to define something for a unique service, as that's the case for networking

Variables can of course also be defined in /etc/rc.conf, but rc.conf.d allows us to manage it from different part of the Salt repository.

Instead of using contents, it's also possible to provision a file, like for iodine: https://devcentral.nasqueron.org/D3291