UBuntu 16.04 – 부팅시 rc.local 파일 실행 되지 않을 때 (systemd 기반 rc.local 활성화)

우분투 16.04 버전은 systemd 기반으로 PID들이 관리된다,
rc.local을 부득이 하게 사용할 일이 생겨 사용하려 했으나 활성화가 안되어 있어서 활성화 방법을 찾아서 기록

 

/lib/systemd/sytem/rc-local.service 을 수정한다.

 

가장 하단에 

 

[#M_ more.. | less.. |[Install]
WantedBy=multi-user.target _M#]

 

​위 와 같이 추가 시켜준 뒤 

[#M_ more.. | less.. |systemctl enable rc-local.service _M#]

 

​rc.local 서비스를 활성화 시켜준다.

Install을 추가시켜주지 않고 활성화를 시켜주려 하면, 해당 부분이 없어 활성화가 되지 않는다.

 

rc.local이 제데로 동작하는지 테스트는 서비스 재시작 뒤 확인 해주면 된다.

[#M_ more.. | less.. |service rc.local restart
systemctl status rc-local.service_M#]

 

​정상적으로 동작한다면 

 

[#M_ more.. | less.. |

root@stream:~# systemctl status rc-local.service

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

   Loaded: loaded (/etc/systemd/system/rc-local.service; static; vendor preset: enabled)

  Drop-In: /lib/systemd/system/rc-local.service.d

           └─debian.conf

   Active: active (running) since Mon 2018-04-02 15:23:37 KST; 3min 43s ago

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

    Tasks: 87

   Memory: 111.9M

      CPU: 3.000s

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

           ├─1529 /usr/local/bin/tvheadend –config /home/TVHeadEnd/.hts/tvheadend/ –user root –gr

           └─1530 /usr/local/bin/istatserver -d

 

Apr 02 15:23:38 stream tvheadend[1529]: scanfile: DVB-C – loaded 18 regions with 60 networks

Apr 02 15:23:38 stream tvheadend[1529]: scanfile: ATSC-T – loaded 2 regions with 12 networks

Apr 02 15:23:38 stream tvheadend[1529]: scanfile: ATSC-C – loaded 1 regions with 5 networks

Apr 02 15:23:38 stream tvheadend[1529]: scanfile: ISDB-T – loaded 2 regions with 1297 networks

Apr 02 15:24:37 stream tvheadend[1529]: iptv: m3u parse: 0 new mux(es) in network ‘IPTV’ (total 116)

 _M#]

active (활성화) 되었다고 표시되며, 하단에 로그도 확인이 가능하다.

댓글

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다