clean up init script, removed unnecessary stuff

This commit is contained in:
Sameer Naik
2014-06-28 19:33:15 +05:30
parent 45d7a98c34
commit 22035c8ee6
2 changed files with 26 additions and 59 deletions
+1 -2
View File
@@ -13,5 +13,4 @@ EXPOSE 5432
VOLUME ["/var/lib/postgresql"] VOLUME ["/var/lib/postgresql"]
ENTRYPOINT ["/app/init"] CMD ["/app/init"]
CMD ["app:start"]
+1 -33
View File
@@ -2,7 +2,6 @@
set -e set -e
appStart () {
# fix permissions and ownership of /var/lib/postgresql # fix permissions and ownership of /var/lib/postgresql
chown -R postgres:postgres /var/lib/postgresql chown -R postgres:postgres /var/lib/postgresql
chmod 700 /var/lib/postgresql chmod 700 /var/lib/postgresql
@@ -30,36 +29,5 @@ appStart () {
echo "| from the data store. |" echo "| from the data store. |"
echo "|------------------------------------------------------------------|" echo "|------------------------------------------------------------------|"
fi fi
tail -F /var/log/postgresql/postgresql-9.1-main.log tail -F /var/log/postgresql/postgresql-9.1-main.log
}
appHelp () {
echo "Available options:"
echo " app:start - Start the postgresql server and watch the log (default)"
echo " app:help - Displays the help"
echo " [command] - Execute the specified linux command eg. bash."
}
case "$1" in
app:start)
appStart
;;
app:help)
appHelp
;;
*)
if [ -x $1 ]; then
$1
else
prog=$(which $1)
if [ -n "${prog}" ] ; then
shift 1
$prog $@
else
appHelp
fi
fi
;;
esac
exit 0