Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Issue: Where does STDOUT from component-prepare go?
#!/usr/bin/env bash
echo ################### mra-server.component-prepare BEGIN ##########################
# TODO: [jsears] Runway is simply using db:setup. Figure out what would initialize the DB in the first place.
# TODO: [jsears] Change me, we don't do a db:drop in production!!!
declare -r mra_db_drop=\"-S rake db:drop\"
declare -r mra_db_setup=\"-S rake db:setup\"
# TODO: [jsears] Look into whether MRA needs this...
#declare -r mra_canary_ensure=\"-S rake canary:ensure\"
set -eu
declare -r root=\"\${Z_SERVICE_ROOT}\"
declare -r jarfile=\"\${root}/lib/mra-all.jar\"
export RAILS_ENV=\"${envtype}\"
echo "mra-server.component-prepare running rake db:drop"
java -jar \"\${jarfile}\" \${mra_db_drop}
echo "mra-server.component-prepare running rake db:setup"
java -jar \"\${jarfile}\" \${mra_db_setup} --trace
# TODO: [jsears] Look into whether MRA needs this...
#echo "mra-server.component-prepare running rake canary:ensure"
#java -jar \"\${jarfile}\" \${mra_canary_ensure} --trace
echo ################### mra-server.component-prepare END ##########################
Oct 30 20:17:02 0-mraApp-jsears.dev.lkt.is systemd[1]: Starting MRA web service...
Oct 30 20:17:02 0-mraApp-jsears.dev.lkt.is mra-server-pre-start[10801]: mra-server.component-prepare running rake db:drop
Oct 30 20:17:03 0-mraApp-jsears.dev.lkt.is systemd[1]: journaldSyslog.service holdoff time over, scheduling restart.
Oct 30 20:17:03 0-mraApp-jsears.dev.lkt.is systemd[1]: Stopping journald syslog streamer...
Oct 30 20:17:03 0-mraApp-jsears.dev.lkt.is systemd[1]: Starting journald syslog streamer...
Oct 30 20:17:03 0-mraApp-jsears.dev.lkt.is systemd[1]: Started journald syslog streamer.
Oct 30 20:17:09 0-mraApp-jsears.dev.lkt.is mra-server-pre-start[10801]: rake aborted!
Oct 30 20:17:09 0-mraApp-jsears.dev.lkt.is mra-server-pre-start[10801]: LoadError: no such file to load -- ci/reporter/rake/rspec
Oct 30 20:17:09 0-mraApp-jsears.dev.lkt.is systemd[1]: journaldSyslog.service: main process exited, code=exited, status=1/FAILURE
Oct 30 20:17:09 0-mraApp-jsears.dev.lkt.is systemd[1]: Unit journaldSyslog.service entered failed state.
Oct 30 20:17:09 0-mraApp-jsears.dev.lkt.is systemd[1]: journaldSyslog.service failed.
Oct 30 20:17:09 0-mraApp-jsears.dev.lkt.is mra-server-pre-start[10801]: /tmp/jruby7147096661125410679extract/Rakefile:20:in `(root)'
Oct 30 20:17:09 0-mraApp-jsears.dev.lkt.is mra-server-pre-start[10801]: (See full trace by running task with --trace)
Oct 30 20:17:09 0-mraApp-jsears.dev.lkt.is mra-server-pre-start[10801]: ERROR: org.jruby.exceptions.RaiseException: (SystemExit) exit
Oct 30 20:17:10 0-mraApp-jsears.dev.lkt.is systemd[1]: mra-server.service: control process exited, code=exited status=1
Oct 30 20:17:10 0-mraApp-jsears.dev.lkt.is systemd[1]: Failed to start MRA web service.
Oct 30 20:17:10 0-mraApp-jsears.dev.lkt.is systemd[1]: Unit mra-server.service entered failed state.
Oct 30 20:17:10 0-mraApp-jsears.dev.lkt.is systemd[1]: mra-server.service failed.
Oct 30 20:17:10 0-mraApp-jsears.dev.lkt.is systemd[1]: mra-server.service holdoff time over, scheduling restart.
Oct 30 20:17:10 0-mraApp-jsears.dev.lkt.is systemd[1]: Stopping MRA web service...
[root@0-mraApp-jsears:~]# systemctl status mra-server.service
● mra-server.service - MRA web service
Loaded: loaded (/nix/store/n48nh39f31b84gf04s1i6yf3h43lk1ny-unit-mra-server.service/mra-server.service)
Active: activating (start-pre) since Fri 2015-10-30 20:15:04 UTC; 3s ago
Control: 10337 (mra-server-pre-)
CGroup: /system.slice/mra-server.service
└─control
├─10337 /nix/store/disi5277lygfj6m7m3ajwvvp9mqdp4la-bash-4.3-p42/bin/bash -e /nix/store/9bb57cqrass3pjw1kbp1yd9xyppv1l7q-unit-script/b...
├─10338 bash /nix/store/jggnppw07qxqzy85hd0nck55q15g8vs3-mra-server/bin/mra-server-component-prepare
└─10339 java -jar /nix/store/jggnppw07qxqzy85hd0nck55q15g8vs3-mra-server/lib/mra-all.jar -S rake db:drop
Oct 30 20:15:04 0-mraApp-jsears.dev.lkt.is mra-server-pre-start[10337]: mra-server.component-prepare running rake db:drop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment