리눅스 x윈도우 환경 설정하기 - xset

리눅스 설치 후 x윈도우 사용시 x윈도우에 대한 콘솔 설정하기

명령어 : xset

- x-window 환경에 대한 옵션을 설정한다

 

리눅스 데스크탑 설치후 스크린세이버, 절전모드를 비활성화하기 위해서 gui관리 메뉴를 통해 설정을 했지만 제대로 적용되지 않았다.

 

구글링을 해보니 xset 이라는 명령어를 통해 간단히 설정 할 수 있었다.

 

* screensaver off 하기

[root@localhost ~]# xset s off

 

* 절전모드 중지하기

[root@localhost ~]# xset -dpms

 

* 현재 설정되어 있는 x윈도우 환경 보기

[root@localhost ~]# xset -q

 

참고1 : xset 설정 (tistory.com)

 

xset 설정

xset SYNOPSISxset ← prompt 상에서 xset 명령어를 치시게 되면 아래와 같은 도움말이 출력됩니다. usage : xset [-display host:dpy] option ... To turn bell off: -b b off b 0 To set bell volume, pitch and duration: b [vol [pitch [dur]]

deois.tistory.com

참고2 : xset 명령 - IBM Documentation

 

xset 명령

용도X-Windows 환경에 대한 옵션을 설정합니다. 구문xset [  -디스플레이 디스플레이 ] [  b [  볼륨  [  피치  [  지속 기간  ] ] ] |  -b |   ... 에 대한 |  b 오프 ] [  백작 | tert-부틸  ]  c.  

www.ibm.com

 

apache 웹서버 재시작(restart)가 안된다

우씨~ apache(httpd)가 갑자기 실행이 안된다......
별로 한것도 없는데.. 

[root@test119 ~]# systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root@test119 ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 목 2021-11-25 10:23:58 KST; 20s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 7536 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 32225 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
  Process: 7523 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 7523 (code=exited, status=1/FAILURE)

11월 25 10:23:58 test119 systemd[1]: Starting The Apache HTTP Server...
11월 25 10:23:58 test119 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
11월 25 10:23:58 test119 kill[7536]: kill: cannot find process ""
11월 25 10:23:58 test119 systemd[1]: httpd.service: control process exited, code=exited status=1
11월 25 10:23:58 test119 systemd[1]: Failed to start The Apache HTTP Server.
11월 25 10:23:58 test119 systemd[1]: Unit httpd.service entered failed state.
11월 25 10:23:58 test119 systemd[1]: httpd.service failed.


config파일들 syntex는 이상없는데..
ssl인증서 기간도 남아 있는데.. 
이것저것 구글링을 하다 보니, 에러로그를 확인해보라고 한다.
내가 아는 에러로그는 apache(httpd) 실행중에 생기는 문제를 기록하는것으로 아는데...
apache가 실행되면서도 잠깐이지만 바로 로그를 기록하는듯... 암튼.
로그를 확인해보니, 

[root@test119 conf.d]# tail /var/log/httpd/error_log
AH00016: Configuration Failed
[Thu Nov 25 10:23:58.816796 2021] [suexec:notice] [pid 7523] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Nov 25 10:23:58.817714 2021] [core:emerg] [pid 7523] (28)No space left on device: AH00023: Couldn't create the ssl-cache mutex
AH00016: Configuration Failed
[Thu Nov 25 10:28:10.437030 2021] [suexec:notice] [pid 7634] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Nov 25 10:28:10.459085 2021] [core:emerg] [pid 7634] (28)No space left on device: AH00023: Couldn't create the rewrite-map mutex
[Thu Nov 25 10:28:10.459102 2021] [:emerg] [pid 7634] AH00020: Configuration Failed, exiting
[Thu Nov 25 10:29:02.522577 2021] [suexec:notice] [pid 7684] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Nov 25 10:29:02.544507 2021] [core:emerg] [pid 7684] (28)No space left on device: AH00023: Couldn't create the rewrite-map mutex
[Thu Nov 25 10:29:02.544526 2021] [:emerg] [pid 7684] AH00020: Configuration Failed, exiting

첨 보는 에러로그다. 
No space left on device: AH00023 ...... 이거 공간이 부족한가?

[root@test119 conf.d]# df
Filesystem           1K-blocks      Used  Available Use% Mounted on
/dev/mapper/cl-root 1942918240 179468112 1763450128  10% /
devtmpfs               4021816         0    4021816   0% /dev
tmpfs                  4037988         0    4037988   0% /dev/shm
tmpfs                  4037988    189684    3848304   5% /run
tmpfs                  4037988         0    4037988   0% /sys/fs/cgroup
tmpfs                  4037988         0    4037988   0% /tmp
/dev/sda2              1038336    169552     868784  17% /boot
/dev/sda1               204580      9672     194908   5% /boot/efi
tmpfs                   807600         0     807600   0% /run/user/0

디시크공간 이상없는데...

Couldn't create the ssl-cache mutex AH00016: Configuration Failed
이건 뭘까.... 구글링 해보자.

 


두번째 "내일은 치킨집 CEO"님의 포스팅 먼저...(국문이라...).
https://www.enteroa.com/tag/no-space-left-on-device/

"Semaphore"라는 프로세스가 생성되었다가 없어지지 않아서...
엄밀히 말하면, "Semaphore" 프로세스 생성 가능한 숫자를 이미 초과해서(No space left on device) 
apache(httpd)가 시작시 새로운 "Semaphore"를 생성하지 못하면서 apache(httpd) 실행이 안된다고 한다.

이건, "Semaphore"가 아파치의 여러 프로세스간 데이타 동기화를 위해 필요한데..
apache(httpd)가 비정상적으로 종료될때 이미 생성된 "Semaphore"를 초기화 되지 못해 그렇다고 한다.

암튼, 일단 
해당 프로세스가 얼마나 있는지 확인

[root@test119 conf.d]# ipcs -s | wc -l
130

130개가 현재 존재중이다.

그럼 최대가능수는?
[root@test119 conf.d]# ipcs -ls

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

현재 max number of arrays 는 128개라고 한다.
이미 초과했고, 초기화(종료) 되어 있지 않아서 apache(httpd)가 실행이 안되니, 
현재 생성되어 있는 Semaphore 를 초기화 하자.
[root@test119 conf.d]# ipcrm -a
[root@test119 conf.d]# ipcs -s | wc -l
4

이제 4개 있다고 한다.(어디서 생성되었지? 초기화 하자 마자 생성되네...)
다시 apache(httpd) 실행을 해보니 잘된다.
[root@test119 conf.d]# systemctl start httpd


이번 에러는 첨 경험해보는 경우이다.
system관리 ..... 넘 어려줘~~



참조 페이지
https://www.enteroa.com/tag/no-space-left-on-device/
https://serverfault.com/questions/991946/no-space-left-on-device-ah00023-couldnt-create-the-mpm-accept-mutex-when-re

mysql에서 join을 이용한 데이타 삭제하기

mysql join을 이용한 데이타 삭제하기

mysql에서는 두개 이상의 table에서 join을 이용해 필터링 되는 데이타를 삭제하기 위해서는 select에서와 같이 join문을 이용해야 하며 여기에서 중요한 점은 using 이라는 문을 더 추가한다는것이다.

예제로 보면, aaa. bbb 라는 테이블을 조인해서  aaa에서 특정 데이타를 삭제하는 구문을 보면

delete from T1 using aaa T1 join bbb T2 on T1.seq = T2.seq where T2.name='홍길동'

이렇게 할경우  T1의 데이타를 삭제하는데 T2와 join 되어 name='홍길동' 인 경우만 삭제하게 된다.
즉, 삭제할 테이블을 FROM 과 USING 사이에 놓으면 된다.

[linux 명령어]여러 파일 권한 한번에 바꾸기


여러파일 권한 바꾸기
 find ./ -type f -name 파일명 -exec chmod 777 {} \;
find 디렉토리시작위치 -type 타입구분(f=팡일 ,d=directory) -name 파일명 -exec chmod 권한 {} \;

위 명령을 이용하면, 디렉토리시작위치에서 하위에 있는 모든 디렉토리에 포함된 파일을 한번에 권한 설정을 해줄수 있다.