挂载文件地址:/etc/rc.local
添加可执行权限
#!/bin/bash
#chkconfig: 2345 80 90
#description:开机自动启动的脚本程序
hostname danse
/usr/local/nginx/sbin/nginx > /dev/null 2>&1 &
/usr/local/php/sbin/php-fpm > /dev/null 2>&1 &
#vm挂载硬盘
#/usr/bin/vmhgfs-fuse .host:/ /root/share -o subtype=vmhgfs-fuse,allow_other
mkdir /var/run/mariadb
touch /var/run/mariadb/mariadb.pid
chown -R mysql /var/run/mariadb
chgrp -R mysql /var/run/mariadb
/usr/local/mysql/bin/mysqld_safe --user=mysql > /dev/null 2>&1 &
/usr/local/mysql/bin/mysqldump -uroot -pdanse_mysql diary > /root/diary.sql > /dev/null 2>&1
#/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf > /dev/null 2>&1 &
/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/mongodb.conf > /dev/null 2>&1 &
/usr/local/memcached/bin/memcached -d -u nobody -l localhost -m 1024 -p 11211 > /dev/null 2>&1 &