Skip to content

Commit

Permalink
Update user for metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
dostrelith678 committed Nov 28, 2021
1 parent 06adaff commit c837410
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions files/docker/grest/docker-entrypoint.sh
Expand Up @@ -8,19 +8,19 @@ apt-get install -y --no-install-recommends cron > /dev/null 2>&1
# To add a user without a password the command is the foloowing:
# adduser --disabled-password --gecos '' guild#
sed -i 's/%sudo.*/%sudo ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers > /dev/null 2>&1
adduser postgres sudo > /dev/null 2>&1
adduser guild sudo > /dev/null 2>&1


# Sets the postgres user cronJobs
chown postgres:root /etc/cron.d/crontab > /dev/null 2>&1
chown guild:root /etc/cron.d/crontab > /dev/null 2>&1
chmod 0660 /etc/cron.d/crontab > /dev/null 2>&1
touch /var/log/cron.log > /dev/null 2>&1
chmod 0660 /var/log/cron.log > /dev/null 2>&1
chown postgres:root /var/log/cron.log > /dev/null 2>&1
crontab -u postgres /etc/cron.d/crontab > /dev/null 2>&1
chown guild:root /var/log/cron.log > /dev/null 2>&1
crontab -u guild /etc/cron.d/crontab > /dev/null 2>&1

# Listen for metrics via postgres user
sudo -u postgres socat TCP-LISTEN:8059,reuseaddr,fork SYSTEM:"echo HTTP/1.1 200 OK;SERVED=true bash /getmetrics.sh " &
# Listen for metrics via guild user
sudo -u guild socat TCP-LISTEN:8059,reuseaddr,fork SYSTEM:"echo HTTP/1.1 200 OK;SERVED=true bash /getmetrics.sh " &

###################### Customisations - END ###################################

Expand Down

0 comments on commit c837410

Please sign in to comment.