From 69f1be56332785c50bed95d30f21a980214b3125 Mon Sep 17 00:00:00 2001 From: Bohung Date: Thu, 10 Mar 2022 00:44:14 +0800 Subject: [PATCH] Fix install Imagemagick bug and check mongo feature. --- install_orbit_environment.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/install_orbit_environment.sh b/install_orbit_environment.sh index bd97c15..6365c84 100644 --- a/install_orbit_environment.sh +++ b/install_orbit_environment.sh @@ -41,10 +41,11 @@ sudo rm -f /tmp/mongodb-27017.sock sudo chown mongodb:mongodb /var/lib/mongodb -R sudo chown mongodb:mongodb /var/log/mongodb -R sudo service mongod restart +sleep 10 if [ -f /tmp/mongodb-27017.sock ]; then echo "Mongo start success!" else - mongo + mongo --eval "db.version()" --quiet exit_code="$(echo $?)" #if mongo 5 core dump, then install mongo 4.4 if [ $exit_code != 0 ] && [ $exit_code != 1 ]; then @@ -82,12 +83,15 @@ if [ -z $(which convert) ]; then wget -nc http://www.imagemagick.org/download/ImageMagick.tar.gz && \ tar xvfz ImageMagick.tar.gz && \ cd $(ls -d ImageMagick-7*) && \ - ./configure --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes --disable-shared --with-modules && \ + chown $USER:$USER . -R" + tmp_pwd=$(pwd) + cd $(ls -d /root/libpng-1.5.13/ImageMagick-7*) + sudo bash -l -c "./configure --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes --disable-shared --with-modules && make && make install && \ ln -s /usr/local/lib/* /usr/lib/. && \ ln -s /usr/local/lib/pkgconfig/* /usr/lib/pkgconfig/. && \ - ln -s /usr/local/bin/* /usr/bin/. && \ - convert -list configure" + ln -s /usr/local/bin/* /usr/bin/. && \ convert -list configure" + cd $tmp_pwd fi ## install rvm if [ -z $(which rvm) ]; then