红联Linux门户
Linux帮助

Fedora 24开机自动启动脚本 - rc.local - rc-local.service

发布时间:2016-08-30 10:23:38来源:linux网站作者:ztguang
以下是Fedora 24开机自动启动脚本。
 
vim /etc/rc.d/rc.local
 
#!/bin/bash  
systemctl start docker.service  
/root/hsl-win7-ns3-root.sh 6 destroy  
/root/hsl-win7-ns3-root.sh 6 destroy  
/root/hsl_install_6_docker-centos-quagga.sh destroy  
/root/hsl_install_6_docker-centos-quagga.sh destroy  
/root/hsl-win7-ns3-root.sh 6 create  
/root/hsl_install_6_docker-centos-quagga.sh create  
 
chmod +x /etc/rc.d/rc.local
vim /usr/lib/systemd/system/rc-local.service
 
#  This file is part of systemd.  
#  
#  systemd is free software; you can redistribute it and/or modify it  
#  under the terms of the GNU Lesser General Public License as published by  
#  the Free Software Foundation; either version 2.1 of the License, or  
#  (at your option) any later version.  
# This unit gets pulled automatically into multi-user.target by  
# systemd-rc-local-generator if /etc/rc.d/rc.local is executable.  
[Unit]  
Description=/etc/rc.d/rc.local Compatibility  
ConditionFileIsExecutable=/etc/rc.d/rc.local  
After=network.target  
[Service]  
Type=forking  
ExecStart=/etc/rc.d/rc.local start  
TimeoutSec=0  
RemainAfterExit=yes  
 
systemctl enable rc-local.service
systemctl status rc-local.service
 
本文永久更新地址:http://www.linuxdiyf.com/linux/23736.html