挂载文件地址:/etc/rc.local
    添加可执行权限

    1. #!/bin/bash
    2. #chkconfig: 2345 80 90
    3. #description:开机自动启动的脚本程序
    4. hostname danse
    5. /usr/local/nginx/sbin/nginx > /dev/null 2>&1 &
    6. /usr/local/php/sbin/php-fpm > /dev/null 2>&1 &
    7. #vm挂载硬盘
    8. #/usr/bin/vmhgfs-fuse .host:/ /root/share -o subtype=vmhgfs-fuse,allow_other
    9. mkdir /var/run/mariadb
    10. touch /var/run/mariadb/mariadb.pid
    11. chown -R mysql /var/run/mariadb
    12. chgrp -R mysql /var/run/mariadb
    13. /usr/local/mysql/bin/mysqld_safe --user=mysql > /dev/null 2>&1 &
    14. /usr/local/mysql/bin/mysqldump -uroot -pdanse_mysql diary > /root/diary.sql > /dev/null 2>&1
    15. #/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf > /dev/null 2>&1 &
    16. /usr/local/mongodb/bin/mongod --config /usr/local/mongodb/mongodb.conf > /dev/null 2>&1 &
    17. /usr/local/memcached/bin/memcached -d -u nobody -l localhost -m 1024 -p 11211 > /dev/null 2>&1 &