-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from flcontainers/dev
fix 1.5.5 update
- Loading branch information
Showing
13 changed files
with
189 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto eol=lf | ||
*.conf text eol=lf | ||
*.properties text eol=lf | ||
*.sh text eol=lf | ||
*.yml text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
enable-clipboard-integration: true | ||
postgresql-hostname: localhost | ||
postgresql-port: 5432 | ||
postgresql-database: guacamole_db | ||
postgresql-username: guacamole | ||
postgresql-password: null | ||
|
||
enable-clipboard-integration: true | ||
postgresql-username: guacamole |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[supervisord] | ||
nodaemon=true | ||
user=root | ||
loglevel = info | ||
pidfile = /tmp/supervisord.pid | ||
logfile = /tmp/supervisord.log | ||
|
||
[program:postgresql] | ||
command=/scripts/postgres/wrapper_supervisor.sh | ||
autostart=true | ||
stdout_logfile=/var/log/supervisor/postgres.log | ||
stderr_logfile=/var/log/supervisor/postgres_error.log | ||
user=postgres | ||
stopwaitsecs=60 | ||
priority=10 | ||
|
||
[program:tomcat] | ||
directory=/opt/tomcat | ||
command=/opt/tomcat/bin/wrapper_supervisor.sh | ||
autostart=true | ||
stdout_logfile=/var/log/supervisor/tomcat.log | ||
stderr_logfile=/var/log/supervisor/tomcat_error.log | ||
user=tomcat | ||
stopwaitsecs=60 | ||
priority=20 | ||
|
||
[program:guacd] | ||
directory=/opt/guacamole | ||
command=/opt/guacamole/wrapper_supervisor.sh | ||
autostart=true | ||
stdout_logfile=/var/log/supervisor/guacd.log | ||
stderr_logfile=/var/log/supervisor/guacd_error.log | ||
user=guacd | ||
stopwaitsecs=60 | ||
priority=30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,42 @@ | ||
#!/bin/sh | ||
|
||
# Create password if DB not initialized | ||
if [ -f "/config/postgres/PG_VERSION" ]; then | ||
echo "DB exisit" | ||
# Define the path to the properties file | ||
PROPERTIES_FILE="/config/guacamole/guacamole.properties" | ||
# Ensure the file exists | ||
if [[ ! -f "$PROPERTIES_FILE" ]]; then | ||
echo "Properties file not found: $PROPERTIES_FILE" | ||
else | ||
# Read the postgresql-password value | ||
POSTGRES_PASSWORD=$(grep -E '^postgresql-password:\s*.*' "$PROPERTIES_FILE" | awk -F': ' '{print $2}' | head -n 1) | ||
# Check if a password was found | ||
if [[ -z "$POSTGRES_PASSWORD" ]]; then | ||
echo "postgresql-password not found in $PROPERTIES_FILE" | ||
else | ||
# Export the value as an environment variable | ||
export POSTGRES_PASSWORD | ||
echo "postgresql-password found in $PROPERTIES_FILE and exported" | ||
fi | ||
fi | ||
else | ||
# Generate a random password for PostgreSQL | ||
echo "Creating db password" | ||
export POSTGRES_PASSWORD=$(pwgen -s 16 1) | ||
echo -e "\npostgresql-password: $POSTGRES_PASSWORD" >> /app/guacamole/guacamole.properties | ||
fi | ||
|
||
echo "Running startup scripts" | ||
/usr/local/bin/_startup.sh | ||
|
||
echo "Running Postgres" | ||
/etc/init.d/postgres start | ||
|
||
echo "Running Guacamole server" | ||
bash -c '/opt/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -f' & | ||
echo "Init DB Check" | ||
/usr/local/bin/_postgres.sh postgres & | ||
|
||
echo "Post startup DB scripts" | ||
gosu postgres bash -c '/usr/local/bin/_post_startup.sh' | ||
|
||
echo "Running Tomcat" | ||
# Wait for postgres to be ready | ||
while ! nc -z localhost 5432; do | ||
sleep 5 | ||
done | ||
/etc/init.d/tomcat start | ||
echo "DB Preparation finished exiting for main processes..." | ||
gosu postgres /bin/sh -c 'pg_ctl -D "$PGDATA" -m fast -w stop' | ||
|
||
echo "container started" | ||
#tail -f /dev/null | ||
# Wait for any process to exit | ||
wait -n | ||
|
||
# Exit with status of process that exited first | ||
exit $? | ||
exec /usr/bin/supervisord -c /etc/supervisord.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
function shutdown() | ||
{ | ||
date | ||
echo "Shutting down Guacd" | ||
|
||
} | ||
|
||
date | ||
echo "Starting Guacd" | ||
|
||
/opt/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -p $GUACD_PID -f | ||
|
||
sleep 5 | ||
|
||
# Allow any signal which would kill a process to stop GUACD | ||
trap shutdown HUP INT QUIT ABRT KILL ALRM TERM TSTP SIGTERM SIGINT | ||
|
||
echo "Waiting for `cat $GUACD_PID`" | ||
wait `cat $GUACD_PID` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
function shutdown() | ||
{ | ||
date | ||
echo "Shutting down Postgresql" | ||
|
||
pg_ctl -m fast -w stop | ||
|
||
} | ||
|
||
date | ||
echo "Starting Postgresql" | ||
|
||
postgres | ||
|
||
sleep 5 | ||
|
||
# Allow any signal which would kill a process to stop Postgres | ||
trap shutdown HUP INT QUIT ABRT KILL ALRM TERM TSTP SIGTERM SIGINT | ||
|
||
echo "Waiting for `head -1 $POSTGRES_PID`" | ||
wait `cat $POSTGRES_PID` |
Oops, something went wrong.