Skip to content

Commit

Permalink
[supervisor.*.conf] Use env variable to dynamically set user based on…
Browse files Browse the repository at this point in the history
… user running CKAN
  • Loading branch information
mpolidori committed Jan 31, 2025
1 parent 5edc863 commit b51ae00
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions ckan-backend-dev/ckan/setup/start_ckan.sh.override
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export SCRIPT_NAME="/private-admin"
if [ $? -eq 0 ]
then
# Start supervisord
export ENV_SUPERVISOR_USER=$(whoami)
supervisord --configuration /etc/supervisord.conf &
# Start uwsgi
sudo -u ckan -EH uwsgi $UWSGI_OPTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ then
fi

# Start supervisord
export ENV_SUPERVISOR_USER=$(whoami)
supervisord --configuration /etc/supervisord.conf &

# Start the development server with automatic reload
Expand Down
8 changes: 4 additions & 4 deletions ckan-backend-dev/ckan/setup/supervisor.harvest.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"
user=%(ENV_SUPERVISOR_USER)s
environment=HOME="/srv/app",USER="%(ENV_SUPERVISOR_USER)s"


[program:ckan-gather]
Expand All @@ -22,5 +22,5 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"
user=%(ENV_SUPERVISOR_USER)s
environment=HOME="/srv/app",USER="%(ENV_SUPERVISOR_USER)s"
4 changes: 2 additions & 2 deletions ckan-backend-dev/ckan/setup/supervisor.worker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"
user=%(ENV_SUPERVISOR_USER)s
environment=HOME="/srv/app",USER="%(ENV_SUPERVISOR_USER)s"
1 change: 1 addition & 0 deletions deployment/ckan/setup/start_ckan.sh.override
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export SCRIPT_NAME="/private-admin"
if [ $? -eq 0 ]
then
# Start supervisord
export ENV_SUPERVISOR_USER=$(whoami)
supervisord --configuration /etc/supervisord.conf &
# Start uwsgi
uwsgi $UWSGI_OPTS
Expand Down
1 change: 1 addition & 0 deletions deployment/ckan/setup/start_ckan_development.sh.override
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ then
fi

# Start supervisord
export ENV_SUPERVISOR_USER=$(whoami)
supervisord --configuration /etc/supervisord.conf &

# Start the development server with automatic reload
Expand Down
8 changes: 4 additions & 4 deletions deployment/ckan/setup/supervisor.harvest.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=root
environment=HOME="/srv/app",USER="root"
user=%(ENV_SUPERVISOR_USER)s
environment=HOME="/srv/app",USER="%(ENV_SUPERVISOR_USER)s"


[program:ckan-gather]
Expand All @@ -22,5 +22,5 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=root
environment=HOME="/srv/app",USER="root"
user=%(ENV_SUPERVISOR_USER)s
environment=HOME="/srv/app",USER="%(ENV_SUPERVISOR_USER)s"
4 changes: 2 additions & 2 deletions deployment/ckan/setup/supervisor.worker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"
user=%(ENV_SUPERVISOR_USER)s
environment=HOME="/srv/app",USER="%(ENV_SUPERVISOR_USER)s"

0 comments on commit b51ae00

Please sign in to comment.