可见,刚刚禁止之后,这个文件中就没有了mariadb.service
[root@localhost linux]# ls /etc/systemd/system/multi-user.target.wants/mariadb.service
ls: cannot access /etc/systemd/system/multi-user.target.wants/mariadb.service: No such file or directory
[root@localhost linux]#
现在利用systemctl将mariadb.service设置为开机自启动
[root@localhost linux]# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@localhost linux]#
再次写ls语句
[root@localhost linux]# ls /etc/systemd/system/multi-user.target.wants/mariadb.service
/etc/systemd/system/multi-user.target.wants/mariadb.service
[root@localhost linux]#