Linux systemctl 常用用法简介(2)

可见,刚刚禁止之后,这个文件中就没有了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]#

systemctl 命令完全指南 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/13337.html