Skip to content

Commit 255dc39

Browse files
committed
Define pidFilePath for offical RHEL packages
The init script in these packages _assumes_ that this variable is defined. Without it, it fails to properly start the service.
1 parent 6ccd0a3 commit 255dc39

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

templates/mongod.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ net:
1010

1111
processManagement:
1212
fork: {{ mongodb_processmanagement_fork | to_nice_json}}
13+
{% if mongodb_pidfile_path is defined and mongodb_pidfile_path != '' -%}
14+
pidFilePath: {{ mongodb_pidfile_path }}
15+
{% endif %}
1316

1417
{% if mongodb_replication_replset -%}
1518
replication:

templates/mongod_init.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ net:
1010

1111
processManagement:
1212
fork: {{ mongodb_processmanagement_fork | to_nice_json }}
13+
{% if mongodb_pidfile_path is defined and mongodb_pidfile_path != '' -%}
14+
pidFilePath: {{ mongodb_pidfile_path }}
15+
{% endif %}
1316

1417
security:
1518
authorization: 'disabled'

vars/RedHat.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ mongodb_repository:
77

88
mongodb_repository_gpgkey:
99
"3.2": "https://www.mongodb.org/static/pgp/server-3.2.asc"
10+
11+
mongodb_pidfile_path: "{{ '/var/run/mongodb/mongod.pid' if ('mongodb-org' in mongodb_package) else '' }}"

0 commit comments

Comments
 (0)