게시물 1,376건
   
logrotate.d//apache2
글쓴이 : 최고관리자 날짜 : 2019-08-05 (월) 14:38 조회 : 2215
글주소 :
                                
/var/log/apache2/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
                if invoke-rc.d apache2 status > /dev/null 2>&1; then \
                    invoke-rc.d apache2 reload > /dev/null 2>&1; \
                fi;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript


postrotate
prerotate
지정된 로그파일에 logrotate작업이 끝나고 난 이후에 실행할 작업을 설정해둔 것이다. 
대부분 이부분에 설정되는 작업은 rotate된 로그파일의 데몬을 재시작시키는 작업이다. 
반대의 작업을 하려면 즉, logrotate작업 전에 실행할 작업이 있다면
postrotate/endscript대신에 prerotate/endscript를 사용하면 된다.


invoke-rc.d : service 와 비슷한 데몬패키지 관리 명령어 
 http://manpages.ubuntu.com/manpages/trusty/man8/invoke-rc.d.8.html
 invoke-rc.d is a generic interface to execute System V style init script  /etc/init.d/name
       actions,  obeying  runlevel  constraints  as  well as any local policies set by the system
       administrator.

       All access to the init scripts by Debian  packages'  maintainer  scripts  should  be  done
       through invoke-rc.d.

       This  manpage  documents  only the usage and behavior of invoke-rc.d.  For a discussion of
       the System V style init script arrangements  please  see  init(8).   More  information  on
       invoke-rc.d  can  be  found  in  the section on runlevels and init.d scripts of the Debian
       Policy Manual.

이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

 



 
사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.