在ubuntu上安装mailutls时候提示
1 2 3 4 5 6 7 8 9 10 11 12 |
root@vds-111783:/rclone# apt-get install mailutils Reading package lists... Done Building dependency tree Reading state information... Done libmysqlclient18 libntlm0 mailutils-common mysql-common Suggested packages: mailutils-mh mailutils-doc The following NEW packages will be installed: guile-2.0-libs libgc1c2 libgsasl7 libkyotocabinet16 libmailutils4 libmysqlclient18 libntlm0 mailutils mailutils-common mysql-common 0 upgraded, 10 newly installed, 0 to remove and 2 not upgraded. FATAL -> Failed to fork. |
网上搜索找到这篇解决方案》https://vsxen.github.io/2016/11/04/ubuntu-faile-to-fork/
只要运行以下脚本即可,意思是解决swap空间不足
1 |
curl -sSL https://manageacloud.com/api/cm/configuration/activate_swap/ubuntu/manageacloud-production-script.sh | bash |
备份脚本:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
#!/bin/bash mkdir -p /tmp/manageacloud/ PREFIX=''; if [ `id -u` != 0 ] ; then PREFIX='sudo -E '; fi apt_timeout="0" until which git || (( "$apt_timeout" > 10 )) do if [ "$apt_timeout" != "0" ]; then sleep 10 fi $PREFIX apt-get install -q git -y || $PREFIX apt-get -q update | cat && $PREFIX apt-get -q install git -y | cat apt_timeout=$[$apt_timeout+1] done cat > /tmp/manageacloud/.manageacloud.sh << 'MACEOL' #!/bin/bash set -ue dd if=/dev/zero of=/swapfile bs=1024 count=512k mkswap /swapfile echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf echo 10 | sudo tee /proc/sys/vm/swappiness chown root:root /swapfile chmod 0600 /swapfile echo " /swapfile none swap sw 0 0 " >> /etc/fstab swapon /swapfile MACEOL #!/bin/bash set +u export DEBIAN_FRONTEND=noninteractive shopt -s xpg_echo unset PATH JAVA_HOME LD_LIBRARY_PATH function abort { echo "aborting: $@" 1>&2 exit 1 } export PATH=/usr/ucb/bin:/bin:/sbin:/usr/bin:/usr/sbin cat > /etc/motd <<EOL ================================================= To debug Manageacloud Bootstrap script: cd /tmp/manageacloud/vcs/ bash .manageacloud.sh Environment variables: cat /tmp/manageacloud/env.log Git repository (if applicable): cd /tmp/manageacloud/vcs/ Any questions support@manageacloud.com ================================================= EOL env > /tmp/manageacloud/env.log PREFIX='' if [ `id -u` != 0 ] ; then PREFIX='sudo -E '; fi echo 'Host * StrictHostKeyChecking no' >> ~/.ssh/config rm -rf /tmp/manageacloud/vcs/ mkdir -p /tmp/manageacloud/vcs/ CLONE="" BRANCH="" PRIV_KEY="" if [ "$PRIV_KEY" != "" ]; then PREFIX=''; if [ `id -u` != 0 ] ; then PREFIX='sudo -E '; fi apt_timeout="0" until which git || (( "$apt_timeout" > 10 )) do if [ "$apt_timeout" != "0" ]; then sleep 10 fi $PREFIX apt-get install -q git -y || $PREFIX apt-get -q update | cat && $PREFIX apt-get -q install git -y | cat apt_timeout=$[$apt_timeout+1] done cd /tmp/manageacloud/ echo '#!/bin/sh if [ -z "$PKEY" ]; then ssh "$@" else ssh -i "$PKEY" "$@" fi' > git_patch.sh chmod +x git_patch.sh echo "$PRIV_KEY" > ~/.ssh/mac_private chmod 600 ~/.ssh/mac_private if [ "$BRANCH" != "" ]; then set -x cd /tmp/manageacloud/vcs/ && GIT_SSH=../git_patch.sh PKEY=~/.ssh/mac_private git clone -q $CLONE . | cat && git checkout $BRANCH set +x fi else PREFIX=''; if [ `id -u` != 0 ] ; then PREFIX='sudo -E '; fi apt_timeout="0" until which git || (( "$apt_timeout" > 10 )) do if [ "$apt_timeout" != "0" ]; then sleep 10 fi $PREFIX apt-get install -q git -y || $PREFIX apt-get -q update | cat && $PREFIX apt-get -q install git -y | cat apt_timeout=$[$apt_timeout+1] done if [ "$BRANCH" != "" ]; then set -x cd /tmp/manageacloud/vcs/ && git clone $CLONE .| cat && git checkout $BRANCH set +x fi fi cp /tmp/manageacloud/.manageacloud.sh /tmp/manageacloud/vcs/ cd /tmp/manageacloud/vcs/ && $PREFIX bash ./.manageacloud.sh | cat test ${PIPESTATUS[0]} -eq 0 exit $? |