Skip to content

Commit

Permalink
[openSUSE] don't rely on PGDATA env var #2041
Browse files Browse the repository at this point in the history
Explicitly define Postgresql db 'data' directory, in openSUSE code path,
via initdb's -D option. Use existing in code pg_data var which is set to
the normal default of '/var/lib/pgsql/data' anyway. Prior use of pg_data
in this code path was ineffectual.
  • Loading branch information
phillxnet committed May 3, 2019
1 parent 8384681 commit fbacd91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rockstor/scripts/initrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def main():
if os.path.isfile('/usr/bin/initdb'):
logger.debug('running generic initdb on {}'.format(pg_data))
run_command(
['su', '-', 'postgres', '-c', '/usr/bin/initdb', pg_data])
['su', '-', 'postgres', '-c', '/usr/bin/initdb -D {}'.format(pg_data)])
logging.info('Done.')
run_command([SYSCTL, 'restart', 'postgresql'])
run_command([SYSCTL, 'status', 'postgresql'])
Expand Down

0 comments on commit fbacd91

Please sign in to comment.