Fedora 21 sets the boot script
Fedora 21 sets the boot script
Sudo touch/etc/rc. d/rc. local
Sudo vim/etc/rc. d/rc. local
Write in the/etc/rc. d/rc. local file, and then save and exit with the: wq command.
#! /Bin/bash
# Write the command to be executed during startup in this file
Grant executable permissions:
Sudo chmod + x/etc/rc. d/rc. local
Set boot start:
Sudo systemctl enable rc-local.service
If the following error message is displayed:
[Root @ dev-zhanghua ~] # Systemctl enable rc-local.service
The unit files have no [Install] section. They are not meant to be enabled
Using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
. Wants/or. requires/directory.
2) A unit's purpose may be to act as a helper for some other unit which has
A requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call ,...).
Sudo vim/usr/lib/systemd/system/rc-local.service
Add at the end of the rc-local.service file:
[Install]
Wantedbypolicmulti-user.tar get
And re-set the boot start:
Sudo systemctl enable rc-local.service
Check the status. If the following prompt is displayed, the setting is successful!
[Zhanghua @ dev-zhanghua ~] $ Systemctl status rc-local.service
● Rc-local.service-/etc/rc. d/rc. local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; enabled)
Active: active (running) since Wed 2015-04-15 11:37:40 CST; 1 h 44 min ago