프로그램 사용/docker2019. 3. 20. 15:17

docker를 통해 cassandra를 구동하는데

csql을 찾지 못해서 헤매는걸 해결하지 못함... 

일단 시간도 없고 귀찮아서 setenforce 0로 하고 다음기회에..


[링크 : https://github.com/instaclustr/cassandra-docker]


+

2019.03.22


찾아보니 이런 에러발생

type=AVC msg=audit(1553061777.728:1930): avc:  denied  { open } for  pid=23358 comm="python" path="/cql/create-keyspace.cql" dev="dm-0" ino=35212277 scontext=system_u:system_r:container_t:s0:c203,c1009 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=1 


이건 어떻게 해결해야 한다냐....

일단은 ll -alZ를 통해서 컨텍스를 보니 아래와 같고

tcontext의 내용과 동일하다.

-rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 cql/create-keyspace.cql 


centos 7에서 확인해보니 container_t 라는건 안보이고 다른걸로 이름을 지어주어야 하나..

# cat /etc/selinux/targeted/contexts/lxc_contexts

process = "system_u:system_r:svirt_lxc_net_t:s0"

content = "system_u:object_r:virt_var_lib_t:s0"

file = "system_u:object_r:svirt_sandbox_file_t:s0"

sandbox_kvm_process = "system_u:system_r:svirt_qemu_net_t:s0"

sandbox_kvm_process = "system_u:system_r:svirt_qemu_net_t:s0"

sandbox_lxc_process = "system_u:system_r:svirt_lxc_net_t:s0"

[링크 : https://prefetch.net/blog/2017/09/30/using-docker-volumes-on-selinux-enabled-servers/]


검색하다 보니 이런게 있었던거 같은데..

# chcon -Rt svirt_sandbox_file_t /var/db

[링크 : https://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/]


+

2019.04.29

If a file is labeled svirt_sandbox_file_t, then by default all containers can read it. But if the containers write into a directory that has svirt_sandbox_file_t ownership, they write using their own category (which in this case is "c186,c641). If you start the same container twice, it will get a new category the second time ( a different category than it had the first time). The category system isolates containers from one another. 


[링크 : https://access.redhat.com/.../docker_selinux_security_policy]

'프로그램 사용 > docker' 카테고리의 다른 글

docker-compose up/down 주의사항  (0) 2019.03.24
docker 컨테이너 자동시작  (0) 2019.03.21
centos docker compose iptable error  (2) 2019.03.20
docker inspect  (0) 2019.02.28
docker 복원하기  (2) 2019.02.27
Posted by 구차니
Linux/centos2019. 3. 20. 10:59

언제나 그렇듯 selinux는 만악의 근원이구만?


80번 포트가 아닌 다른 포트를 쓰려고 할때 httpd 데몬이 실행안되는 경우

(아래는 5000번 포트를 웹 서버로 쓰려고 할 경우)

# semanage port -m -t http_port_t -p tcp  5000

# semanage port -a -t http_port_t -p tcp  5000

[링크 : http://egloos.zum.com/dochi575/v/4867779]

[링크 : https://stackoverflow.com/questions/17079670/]


php 페이지가 열리지 않을 경우

# ls -Z

# sudo chcon -t httpd_sys_content_t /var/www/html -R

[링크 : https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/]


'Linux > centos' 카테고리의 다른 글

리눅스 로그인 실패 로그  (2) 2019.07.07
centos7 USB 설치 중 /dev/root dose not exist 에러  (0) 2019.07.02
'abrt-cli status' timed out  (0) 2019.03.01
centos nfs client  (0) 2019.02.27
centos timezone 변경  (2) 2019.02.23
Posted by 구차니
프로그램 사용/docker2019. 3. 20. 10:27

docker-compose를 통해서 docker를 생성하는데 

Creating network "docker_default" with the default driver

ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule:  (iptables failed: iptables --wait -t nat -I DOCKER -i br-7d5a8bad2e77 -j RETURN: iptables: No chain/target/match by that name.

 (exit status 1)) 


요런에러가 발생하는데...


환경은 centos 7. 아래와 같이 설정하니 일단은 넘어가네


# vim /lib/systemd/system/docker.service

[Unit]

Description=Docker Application Container Engine

Documentation=http://docs.docker.com

After=network.target

Wants=docker-storage-setup.service

Requires=docker-cleanup.timer 


After=network.target docker.socket

Requires=network.target docker.socket 

[링크 : https://github.com/sameersbn/docker-gitlab/issues/499]

'프로그램 사용 > docker' 카테고리의 다른 글

docker 컨테이너 자동시작  (0) 2019.03.21
docker cassandra selinux  (0) 2019.03.20
docker inspect  (0) 2019.02.28
docker 복원하기  (2) 2019.02.27
docker 개념 다시 조사..  (0) 2019.02.01
Posted by 구차니

pg_hba.conf 외에도, role을 바꾸어 주어야 하네?


 ALTER ROLE "asunotest" WITH LOGIN;

[링크 : https://stackoverflow.com/questions/35254786/postgresql-role-is-not-permitted-to-log-in]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgresql import from csv  (0) 2019.06.04
postgresql password chg  (0) 2019.06.04
postgresql WAL?  (0) 2019.03.14
postgresql encoding / collate  (0) 2019.03.08
postgresql 설치(centos)  (0) 2019.03.08
Posted by 구차니
프로그램 사용/nginx2019. 3. 20. 09:39

하라는데로 하니 되긴 한데

결론은.. selinux와 쌍벽을 이룰 끝판왕의 도래인가?



대개는 403에러에 대해서 나오는데 운이 좋게 쉽게 검색한듯..

일단 audit.log를 보는데 먼 소리인지 모르겠다 -ㅁ-

nginx가 http를 돌리기 위해서 tcp_socket을 쓰려는데 아무래도 3000번으로 80번으로 돌리려고 하다 보니 

well known이거나 1024번 이하 포트라서 audit에 의해 걸러지고 있었을 지도?


# cat /var/log/audit/audit.log | grep nginx | grep denied

type=AVC msg=audit(1553041491.494:21600): avc:  denied  { name_connect } for  pid=17240 comm="nginx" dest=3000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket permissive=0


# cat /var/log/audit/audit.log | grep nginx | grep denied | audit2allow -M swnginx

******************** IMPORTANT ***********************

To make this policy package active, execute:


semodule -i swnginx.pp


# semodule -i swnginx.pp

 


[링크 : https://crystalcube.co.kr/181]

Posted by 구차니
회사일/Epson L805 rpi2019. 3. 19. 11:26

epson 프린터 제어용 언어인데..

brother 라던가 다른데서도 쓸 수 있나 보네?


그나저나.. 예전에 헤더 청소나, 파워 플러시 할때도 0x1b가 보였던거 같은데....


[링크 : https://docs.microsoft.com/ko-kr/windows/uwp/devices-sensors/epson-esc-pos-with-formatting]

'회사일 > Epson L805 rpi' 카테고리의 다른 글

epson 개발자 사이트  (0) 2019.03.26
Epson L805 power flush  (0) 2019.02.07
epson L805 헤드 청소(성공) 및 종료 시점 확인하기(실패)  (0) 2018.12.21
escputil 디버그 모드  (0) 2018.12.21
rpi epson printer  (0) 2018.12.20
Posted by 구차니
Programming/angular2019. 3. 18. 10:14

요즘 머리가 굳어서 안돌아가나..

예제가 친절하게 있어도 어떻게 쓰는지 감이 1도 안온다.. ㅠㅠ


아무튼 make -j 처럼 멀티코어 빌드하는 방법을 찾아보는 중


[링크 : https://www.npmjs.com/package/parallel-webpack-ng]

[링크 : https://survivejs.com/webpack/optimizing/performance/]

[링크 : https://blog.box.com/blog/how-we-improved-webpack-build-performance-95]

'Programming > angular' 카테고리의 다른 글

angular with reverse proxy  (0) 2019.03.18
angular4 ie11 호환성 설정  (0) 2019.02.18
angular proxy  (0) 2018.11.02
vscode 및 angular.js 셋팅..  (0) 2018.08.08
Posted by 구차니
Programming/angular2019. 3. 18. 10:06

packge.json에

proxy.conf.json을 추가하여 빌드시에 적용하는 듯



{

  "/api": {

    "target": "http://localhost:3000",

    "secure": false

  }


"architect": {

  "serve": {

    "builder": "@angular-devkit/build-angular:dev-server",

    "options": {

      "browserTarget": "your-application-name:build",

      "proxyConfig": "proxy.conf.json"

    },



[링크 : https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/proxy.md]

[링크 : https://gompro.postype.com/post/732269]



+

예전에 단순하게 url만 상대경로로 바꾸고 시도를 했었는데 제대로 안되서

넘어갔었는데 이 부분이 누락되서 그랬던 듯

'Programming > angular' 카테고리의 다른 글

angular 빌드 최적화(?)  (0) 2019.03.18
angular4 ie11 호환성 설정  (0) 2019.02.18
angular proxy  (0) 2018.11.02
vscode 및 angular.js 셋팅..  (0) 2018.08.08
Posted by 구차니
개소리 왈왈/자전거2019. 3. 17. 18:50

자전거 튜브 2개

안장 가방 1개(파란색)

hexus 2 공구


몇개 산거 아니거 같은데 총 3.9만..

(hexus2가 2.2만이라는게 함정, 튜브 하나당 6천이었나? 가방 5천)


아무튼 뒷 바퀴 실펑크가 났는지 바람이 만땅으러 넣어놔도 하루만에 빠지니까

후다닥 가서 갈아야지 ㅠㅠ

Posted by 구차니
Posted by 구차니