블로그 이미지
redkite

카테고리

분류 전체보기 (291)
00.SI프로젝트 산출물 (0)
00.센터 운영 문서 (0)
01.DBMS ============.. (0)
01.오라클 (117)
01.MS-SQL (15)
01.MySQL (30)
01.PostgreSql (0)
01.DB튜닝 (28)
====================.. (0)
02.SERVER ==========.. (0)
02.서버-공통 (11)
02.서버-Linux (58)
02.서버-Unix (12)
02.서버-Windows (2)
====================.. (0)
03.APPLICATION =====.. (11)
====================.. (0)
04.ETC =============.. (0)
04.보안 (5)
====================.. (0)
05.개인자료 (1)
06.캠핑관련 (0)
07.OA관련 (1)
Total
Today
Yesterday

달력

« » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

공지사항

최근에 올라온 글

find 의 -perm 옵션은 보통 3가지 mode 를 사용합니다.

  1. -perm mode
  2. -perm -mode
  3. -perm /mode

mode 는 정확하게 mode 가 매치되는 것만

-mode 는 mode 를 포함하고, 추가적인 퍼미션이 있는 것만

/mode 는 mode 에서 한개 bit라도 매치되는 것이 있으면

아래의 예들을 실행해 보시면 이해에 도움이 되실 겁니다.

하나의 임시 디렉토리 속에 아래 명령으로 모든 가능한 퍼미션을 만들고 테스트 해보세요.

for i in $(seq 0 7); do for j in $(seq 0 7); do for k in $(seq 0 7); do  touch ${i}${j}${k}; chmod ${i}${j}${k} ${i}${j}${k}; done; done; done

아래는 서로 결과가 같고, 퍼미션이 0700인 것만 찾습니다.

find . -perm u+rwx

find . -perm u=rwx

find . -perm 0700

find . -perm 700

아래는 서로 결과가 같고, 퍼미션이 0020인 것만 찾습니다.

find . -perm g+w

find . -perm g=w

find . -perm 0020

find . -perm 020

find . -perm 20

아래는 서로 결과가 같고, 퍼미션이 0500 보다 더 많이 허용된 것을 찾습니다.

find . -perm -u+rx

find . -perm -u=rx

find . -perm -0500

find . -perm -500

아래는 서로 결과가 같고, 퍼미션 0771 의 각 권한(rwxrwxrwx) 중 한 개 이상의 권한이 같은 것을 찾습니다.

find . -perm /u+rwx,g+rwx,o+x

find . -perm /u=rwx,g=rwx,o=x

find . -perm /u=rwx,g=rwx,o+x

find . -perm /0771

find . -perm /771

아래와 같이 !을 붙일 때 찾을 수 있는 퍼미션의 예상은

find . ! -perm /u+rwx,g+rwx,o+x -ls

-------rw-

--------w-

----------

-------r--

입니다.

참조하세요 ^^

추가질문에 대한 답변

-perm -2 -o -perm -20

-o 는 or 의 의미입니다.

-perm -2 또는 -perm -20 입니다.

other 가 writable 이상이거나 또는 group 이 writable 이상인 것을 의미합니다.

즉, other 또는 group 에 실행권한이 있는 파일을 의미합니다.

같은 의미지만 반대로 이야기 하면, 실행권한이 user 에게만 있거나 아예 없는 파일을 제외한 파일을 의미합니다.

만약,

find ../ ! -user mylin \( -perm 2 -o -perm -20 \) -exec {} \; 이라면

상위 디렉토리의 하위로 소유자가 user가 아니고 other나 group 에 실행권한이 있는 파일을 찾아서 실행한다

는 의미가 됩니다.

 

'02.서버-Linux' 카테고리의 다른 글

[리눅스]CentOS virbr0 NAT disable  (0) 2013.05.08
[리눅스]멀티 환경변수 case 문 이용  (0) 2013.03.29
[리눅스]RPM Failed dependencies  (0) 2013.03.28
[리눅스]NDD & TCPDUMP  (0) 2013.03.25
[리눅스]SoftWare RAID10  (0) 2013.03.18
Posted by redkite
, |

Service management details

svcs(1) command

System administrators can more easily monitor services using Solaris Service Manager’s service status information and service activation/deactivation interfaces based on the commands (svcs(1), svcadm(1) etc). Until Solaris 9, it was a complicated procedure to understand service status. Service level information was not provided and system administrators have to assume service status from their own analysis of kernel level information. A slow and error prone process.

svcadm(1M) command

Services and the services on which they depend are started in their appropriate order using the Solaris Service Manager svcadm(1) command. System administrators are longer required to run complicated service startup operations.

For example, if there are two services, Service A and Service B, and Service A depends on Service B, previously the system administrator needed to start the services paying close attention to their dependent relationship. Now with Solaris10, they only have to start Service A. Solaris Service Manager automatically detects that Service B needs to be started, and starts the services in the right sequence.

사용자 삽입 이미지

With Solaris 10 the traditional service stop procedure using the kill(1) or pkill(1) commands is no longer available. This is because, once stopped, Solaris Service Manager will automatically restart them. So a new command, svcadm (1M) is now used for stopping services.

References
 Solaris 9 or earlier versionsSolaris 10
Service statusps(1) command 
(only process information is shown)
svcs(1) or ps(1) command
Service stop# /etc/init.d/cron stop# svcadm disable -t 
system/cron:default
Service restart (temporary)# /etc/init.d cron start# svcadm enable -t 
system/cron:default
Service stop 
After service restart the service isn't started
(1)# /etc/init.d/cron stop 
(2)# mv /etc/rc2.d/S75cron /etc/rc2.d/_S75cron 
(Need to rename the service start script)
# svcadm disable -t 
system/cron:default
Service restart (permanent)(1) # /etc/init.d/cron stop 
(2) # /etc/init.d/cron start
# svcadm restart -t 
system/cron:default


- Solaris 10 간단한 재실행
# svcs cron
STATE          STIME    FMRI
online          4월_26  svc:/system/cron:default
svcadm restart cron
#
# svcs cron
STATE          STIME    FMRI
online         11:26:41 svc:/system/cron:default

Posted by redkite
, |

sendmail은 목적지를 확인하지 못한 메일을 clientmqueue에 임시로 저장했다가 목적지가 확인되면 mqueue로 보내서 메일을 발송하는 거라고 한다. 그런데 sendmail을 사용하지 않는 시스템에서 이러한 일이 발생하는 것은 logwatch에서 주요로그보고서를 메일로 발송하는 것 때문에 이러한 문제가 발생한다고 한다.

 

logwatch의 메일발송기능을 없애려면 /etc/contab의 내용에서 MAILTO=root의 내용에서 root로 지정된것을 뺴주면 된다고 한다.

 

엄청나게 많은 파일이 생긴 clientmqueue디렉토리는 한번에 지우기가 어려운데 아래의 명령으로 한번에 지울수 있다고 한다.

해당 디렉터리로 이동 후 아래 명령을 실행한다.
ls | xargs rm -f

 

아니면, 아예 폴더 자체를 날려버리고 새로 만들어도 상관 없다.

rm -rf /var/spool/clientmqueue

mkdir /var/spool/clientmqueue

chown smmsp.smmsp /var/spool/clientmqueue

 

주기적으로 지워지게 crontab에 삭제 명령어를 등록할 수도 있따.

$ crontab -e
30 0 * * * /usr/bin/find /var/spool/clientmqueue -mtime +30 | xargs rm -f 

Posted by redkite
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함