세상은 넓고 할 것은 많다.

Centos7 rc.local 실행 안될 경우 본문

IT/LINUX

Centos7 rc.local 실행 안될 경우

ssung85 2020. 10. 26. 21:27
728x90

1. 권한

[root@NASbackup ~]# ll /etc/rc.d/rc.local

-rw-r--r--. 1 root root 889 10월 16 17:19 /etc/rc.d/rc.local

[root@NASbackup ~]# chmod +x /etc/rc.d/rc.local

[root@NASbackup ~]# ll /etc/rc.d/rc.local

-rwxr-xr-x. 1 root root 889 10월 16 17:19 /etc/rc.d/rc.local

 

2. Vi  /usr/lib/systemd/system/rc.local 추가

[Install]

WantedBy=multi-user.target

 

3. 서비스 시작

[root@NASbackup ~]# systemctl restart rc-local.service

Warning: rc-local.service changed on disk. Run 'systemctl daemon-reload' to reload units.

 

[root@NASbackup ~]#

[root@NASbackup ~]# systemctl status rc-local.service

● rc-local.service - /etc/rc.d/rc.local Compatibility

   Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled)

   Active: active (running) since 월 2020-10-19 09:53:35 KST; 10s ago

  Process: 2391 ExecStart=/etc/rc.d/rc.local start (code=exited, status=0/SUCCESS)

 Main PID: 2396 (avsms)

   CGroup: /system.slice/rc-local.service

           └─2396 /usr/local/sysmanagerone/avsms

 

10월 19 09:53:29 NASbackup systemd[1]: Starting /etc/rc.d/rc.local Compatibility...

10월 19 09:53:35 NASbackup systemd[1]: Started /etc/rc.d/rc.local Compatibility.

Warning: rc-local.service changed on disk. Run 'systemctl daemon-reload' to reload units.

 

4. Enable 하기

[root@NASbackup ~]# systemctl enable rc-local.service

Created symlink from /etc/systemd/system/multi-user.target.wants/rc-local.service to /usr/lib/systemd/system/rc-local.service.

[root@NASbackup ~]# systemctl list-unit-files |grep rc.local

rc-local.service                              enabled

 

5. 경고 나올 명령어 실행

[root@NASbackup ~]# systemctl daemon-reload

[root@NASbackup ~]#

 

 

728x90
Tag
0 Comments
댓글쓰기 폼