Skip to content

Commit d48f6f2

Browse files
committed
Make sure the service is enabled on "deb"-based operating systems
1 parent 87f6cd8 commit d48f6f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

postgres/server.sls

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,18 @@ postgresql-start:
130130
- unless:
131131
- ps -p $(head -n 1 {{ postgres.conf_dir }}/postmaster.pid) 2>/dev/null
132132
133-
# Try to enable PostgreSQL in "manual" way for systemd and RedHat-based distros.
134-
# The packages for other OS (i.e. `*.deb`) should do it automatically by default
133+
# Try to enable PostgreSQL in "manual" way if Salt `service` state module
134+
# is currently not available (e.g. during Docker or Packer build when is no init
135+
# system running)
135136
136137
postgresql-enable:
137138
cmd.run:
138139
{%- if salt['file.file_exists']('/bin/systemctl') %}
139140
- name: systemctl enable {{ postgres.service }}
140141
{%- elif salt['cmd.which']('chkconfig') %}
141142
- name: chkconfig {{ postgres.service }} on
143+
{%- elif salt['file.file_exists']('/usr/sbin/update-rc.d') %}
144+
- name: update-rc.d {{ service }} defaults
142145
{%- else %}
143146
# Nothing to do
144147
- name: 'true'

0 commit comments

Comments
 (0)