centos7 rc.local无效

394 阅读1分钟

 centos7变化很大,降低了rc.local优先级,但没取消。

  1. chmod +x  /etc/rc.d/rc.local
  2. systemctl enable rc-local.service 
  3. systemctl start rc-local.service

----------------------option----------------------------

  • vim /lib/systemd/system/rc-local.service

[Install]

WantedBy=multi-user.target

  • ln -s '/lib/systemd/system/rc-local.service' '/etc/systemd/system/multi-user.target.wants/rc-local.service'
  • systemctl enable rc-local.service
  • Systemctl start rc-local.service