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 ~]#
'IT > LINUX' 카테고리의 다른 글
LINUX 명령어 반복 실행 시키는 간단한 방법 (3) | 2020.11.06 |
---|---|
CentOS6 Interface 4개 Bonding으로 대역폭 상승 시키기 (0) | 2020.11.05 |
Centos7 ssh port 변경 (0) | 2020.10.22 |
Tomcat 종료 지연 현상 (0) | 2020.10.22 |
df-h 명령어 실행 할때 tmpfs 숨기기 (0) | 2020.10.16 |