首页 > 代码库 > Linux将进程写入开机自启动

Linux将进程写入开机自启动

只需将启动的命令写入/etc/rc.local

如让mongodb开机自启动:
echo "/usr/local/mongodb/bin/mongod --dbpath=/usr/local/mongodb/data/db --logpath=/usr/local/mongodb/logs/mongodb.log --fork" >> /etc/rc.local