우분투에서 vino-server 보다 x11vnc 가 나은듯 하다.

x11vnc 를 설치해보자

apt-get install x11vnc xinetd

로 설치해준다.

그리고, xinetd 는 x11vnc 를 자동실행시켜주기 위해 사용한다(취향에 따라 gdm 로그인시 자동실행시켜도 된다.)

/etc/xinetd.d/x11vnc 로 다음 내용을 저장한다.

service x11vnc
{
   port = 5901
   type = UNLISTED
   socket_type = stream
   protocol = tcp
   wait = no
   user = root
   server = /usr/bin/x11vnc
   server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -xkb -repeat -many -bg -noxdamage -rfbauth /etc/x11vnc.passwd
   disable = no
}


여기서 조심할 항목은 /etc/x11vnc.passwd 의 암호를 지정하는 것이다.

x11vnc -storepasswd /etc/x11vnc.passwd


로 하면 암호를 물어보고, 해당 파일로 저장이 된다.

server_args 부분설명
  -noxdamage :  compiz 상에서 화면갱신등의 성능이 좋지 않는데, 저 옵션을 주면 좋아진다.

  -xkb -repeat  : shift 키가 안먹을때 넣어 준다.

  -auth {xauth} : ps aux | grep auth  명령으로 위치를 찾아준다.

/usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

ubuntu 14.04 에서는 위와 같다. lightdm 부분 /var/run/lightdm/root/:0 을 -auth 옵션뒤에 넣어준다.

 

설정 완료 후에는 xinetd 를 재시작 해준다.

service xinetd restart

 

[추가-2020-03-31]

우분투 18.04 에서는 lightdm 대신에 gdm 을 사용한다.(auth 부분이 /run/user/121/gdm/Xauthority 이다 )
특정 시스템의 문제인지 모르겠지만, 로그인 하면 검정화면이 된다.

해결 방법이 있을듯 하지만, 그냥 lightdm 을 설치해서 해결했다.

apt install lightdm

 

반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,

올레별. 참 쓸데가 없다.

10만점 가량을 어머니 통화료 쓰시라고 보내드렸는데, 몇개월 쓰니까 종료한다고 나오네. 흠.
더욱 쓸데가 없어진 올레 별.

어따 쓰지.


오포인트? 라는 것으로 전환하면 뭔가 쓸데가 있으려나?





반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,

btrfs 를 사용하고 있는데, 아직 익숙하지 않은지, 뭔가 이상한 부분들이 있다.

virtualbox 가상머신을 사용하던중 프리징 되는 현상이 발생했다. 그냥 강제종료를 하니 이제 뜨지 않는다.ㅜㅜ


커널에러가 발생하는 듯 싶다. 커널호환이 안되는 것인가?

다음과 같은 커널에러가 발생한다.

# cat kern.log-btrfs-panic
[  115.018518] ------------[ cut here ]------------
[  115.018540] kernel BUG at /build/buildd/linux-3.13.0/fs/btrfs/ctree.c:3166!
[  115.018563] invalid opcode: 0000 [#1] SMP
[  115.018578] Modules linked in: pci_stub vboxpci(OF) vboxnetadp(OF) vboxnetflt(OF) vboxdrv(OF) snd_hda_codec_hdmi snd_hda_codec_realtek x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel dm_multipath scsi_dh aesni_intel aes_x86_64 lrw gf128mul glue_helper snd_hda_intel snd_hda_codec ablk_helper snd_hwdep cryptd rts5139(C) snd_pcm arc4 btusb snd_page_alloc rtl8723ae rtl8723_common rtl_pci rtlwifi snd_seq_midi snd_seq_midi_event mac80211 joydev snd_rawmidi serio_raw snd_seq cfg80211 snd_seq_device lpc_ich nouveau i915 snd_timer ttm mei_me drm_kms_helper mei drm snd i2c_algo_bit soundcore bnep rfcomm bluetooth mxm_wmi msi_wmi sparse_keymap binfmt_misc wmi parport_pc video mac_hid ppdev lp parport hid_generic hid_logitech_dj usbhid hid btrfs libcrc32c raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor psmouse ahci raid6_pq libahci raid1 raid0 alx mdio multipath linear dm_mirror dm_region_hash dm_log
[  115.018939] CPU: 1 PID: 732 Comm: btrfs-endio-wri Tainted: GF        C O 3.13.0-35-generic #62-Ubuntu
[  115.018966] Hardware name: Micro-Star International Co., Ltd. CR42 2M/GE40 2OC/MS-1492, BIOS E1492IMS.30O 01/29/2014
[  115.018996] task: ffff880222c8e000 ti: ffff8800b9a04000 task.ti: ffff8800b9a04000
[  115.019018] RIP: 0010:[<ffffffffa00f1a31>]  [<ffffffffa00f1a31>] btrfs_set_item_key_safe+0x161/0x170 [btrfs]
[  115.019063] RSP: 0018:ffff8800b9a05b70  EFLAGS: 00010246
[  115.019079] RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00000005e87b0000
[  115.019099] RDX: 0000000000000000 RSI: ffff8800b9a05c76 RDI: ffff8800b9a05b8f
[  115.019119] RBP: ffff8800b9a05bc8 R08: 0000000000000001 R09: ffff8800b9a05b90
[  115.019139] R10: 00000005e87b8000 R11: 00000000ffffffff R12: ffff8800b9a05b7e
[  115.019160] R13: ffff88003612a7e0 R14: ffff8800b9a05c76 R15: ffff880114d79680
[  115.019181] FS:  0000000000000000(0000) GS:ffff88022fa80000(0000) knlGS:0000000000000000
[  115.019204] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  115.019221] CR2: 00007f5d0c011088 CR3: 000000018e42b000 CR4: 00000000001427e0
[  115.019242] Stack:
[  115.019249]  ffff880035e61000 0118ffffa012a959 006c000000000000 1800000005e87b00
[  115.019274]  6c00000000000001 00000005e87b0000 ffff880114d79680 00000005e87b0000
[  115.019298]  0000000000000000 0000000000000ef7 ffff88003612a7e0 ffff8800b9a05cc0
[  115.019323] Call Trace:
[  115.019349]  [<ffffffffa0127ae1>] __btrfs_drop_extents+0x421/0xad0 [btrfs]
[  115.019374]  [<ffffffff810aafe2>] ? autoremove_wake_function+0x12/0x40
[  115.019406]  [<ffffffffa0128d10>] btrfs_drop_extents+0x60/0x90 [btrfs]
[  115.019435]  [<ffffffffa01188cc>] insert_reserved_file_extent.constprop.53+0x6c/0x290 [btrfs]
[  115.019467]  [<ffffffffa011e375>] btrfs_finish_ordered_io+0x2e5/0x570 [btrfs]
[  115.019495]  [<ffffffffa011e885>] finish_ordered_fn+0x15/0x20 [btrfs]
[  115.019523]  [<ffffffffa014219a>] worker_loop+0x15a/0x5c0 [btrfs]
[  115.019550]  [<ffffffffa0142040>] ? btrfs_queue_worker+0x310/0x310 [btrfs]
[  115.019572]  [<ffffffff8108b4a2>] kthread+0xd2/0xf0
[  115.019588]  [<ffffffff8108b3d0>] ? kthread_create_on_node+0x1c0/0x1c0
[  115.019608]  [<ffffffff8172ecbc>] ret_from_fork+0x7c/0xb0
[  115.019625]  [<ffffffff8108b3d0>] ? kthread_create_on_node+0x1c0/0x1c0
[  115.019644] Code: 48 8b 45 bf 48 8d 7d c7 4c 89 f6 48 89 45 d0 0f b6 45 be 88 45 cf 48 8b 45 b6 48 89 45 c7 e8 97 f2 ff ff 85 c0 0f 8f 48 ff ff ff <0f> 0b 0f 0b 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55
[  115.019750] RIP  [<ffffffffa00f1a31>] btrfs_set_item_key_safe+0x161/0x170 [btrfs]
[  115.019779]  RSP <ffff8800b9a05b70>
[  115.029262] ---[ end trace 642f12bbe4eff1cc ]---


일단 마운트 해제하고, btrfsck 를 해본다.

# btrfsck --repair /dev/vg_data/lv_data
enabling repair mode
Checking filesystem on /dev/vg_data/lv_data
UUID: c5cd286a-980e-414e-b10a-aacbf5c5e449
checking extents
checking free space cache
cache and super generation don't match, space cache will be invalidated
checking fs roots
root 5 inode 280 errors 180, file extent overlap, file extent discount
found 18378234624 bytes used err is 1
total csum bytes: 58871948
total tree bytes: 193949696
total fs tree bytes: 48832512
total extent tree bytes: 58753024
btree space waste bytes: 45925595
file data blocks allocated: 3653029335040
 referenced 52821159936
Btrfs v3.12

뭔가 고치긴 한것 같다.


그런데, virtualbox 를 다시 실행해도 같은 에러가 발생한다.

커널버전을 낮춰볼까?



다시 체크를 해보니

# btrfsck /dev/vg_data/lv_data
Checking filesystem on /dev/vg_data/lv_data
UUID: c5cd286a-980e-414e-b10a-aacbf5c5e449
checking extents
checking free space cache
free space inode generation (0) did not match free space cache generation (57150)
free space inode generation (0) did not match free space cache generation (57150)
free space inode generation (0) did not match free space cache generation (57151)
free space inode generation (0) did not match free space cache generation (57150)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57134)
free space inode generation (0) did not match free space cache generation (56404)
free space inode generation (0) did not match free space cache generation (57135)
free space inode generation (0) did not match free space cache generation (26053)
free space inode generation (0) did not match free space cache generation (56713)
free space inode generation (0) did not match free space cache generation (57137)
free space inode generation (0) did not match free space cache generation (57139)
free space inode generation (0) did not match free space cache generation (57148)
free space inode generation (0) did not match free space cache generation (57097)
free space inode generation (0) did not match free space cache generation (56684)
free space inode generation (0) did not match free space cache generation (57124)
free space inode generation (0) did not match free space cache generation (56680)
free space inode generation (0) did not match free space cache generation (56646)
free space inode generation (0) did not match free space cache generation (57050)
free space inode generation (0) did not match free space cache generation (56697)
free space inode generation (0) did not match free space cache generation (56681)
free space inode generation (0) did not match free space cache generation (57078)
free space inode generation (0) did not match free space cache generation (57087)
free space inode generation (0) did not match free space cache generation (57118)
free space inode generation (0) did not match free space cache generation (57078)
free space inode generation (0) did not match free space cache generation (57107)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57097)
free space inode generation (0) did not match free space cache generation (57097)
free space inode generation (0) did not match free space cache generation (57140)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57083)
free space inode generation (0) did not match free space cache generation (52539)
free space inode generation (0) did not match free space cache generation (56699)
free space inode generation (0) did not match free space cache generation (57141)
free space inode generation (0) did not match free space cache generation (57088)
free space inode generation (0) did not match free space cache generation (57097)
free space inode generation (0) did not match free space cache generation (57055)
free space inode generation (0) did not match free space cache generation (57087)
free space inode generation (0) did not match free space cache generation (57097)
free space inode generation (0) did not match free space cache generation (56527)
free space inode generation (0) did not match free space cache generation (57097)
free space inode generation (0) did not match free space cache generation (47463)
free space inode generation (0) did not match free space cache generation (57081)
free space inode generation (0) did not match free space cache generation (57097)
free space inode generation (0) did not match free space cache generation (57097)
free space inode generation (0) did not match free space cache generation (57056)
free space inode generation (0) did not match free space cache generation (57141)
free space inode generation (0) did not match free space cache generation (57150)
free space inode generation (0) did not match free space cache generation (57150)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57147)

free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57070)
free space inode generation (0) did not match free space cache generation (57090)
free space inode generation (0) did not match free space cache generation (57148)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57122)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57118)
free space inode generation (0) did not match free space cache generation (57147)
free space inode generation (0) did not match free space cache generation (57097)
checking fs roots
root 5 inode 280 errors 180, file extent overlap, file extent discount
found 45291307607 bytes used err is 1
total csum bytes: 58871948
total tree bytes: 193966080
total fs tree bytes: 48832512
total extent tree bytes: 58769408
btree space waste bytes: 45951279
file data blocks allocated: 3653012492288
 referenced 52804317184
Btrfs v3.12

이런 엄청난 메시지가..

btrfsck 로는 해결이 안되는 것 같다.

그냥 btrfs 를 버리고 ext4 로 해야겠다.
btrfs 의 데이터를 다른곳으로 옮기고, mkfs.ext4 로 다시 생성, 다시 복사. 끝.

ext4 로 바꾸고 다시 해보니 일단은 정상적인 듯 하다.

btrfs 는 문제해결능력을 더 키운후에 다시 도전해야 겠다.

data 는 그냥 바꾸면 되는데, root 는 어떻게 할지 고민해봐야겠다.
btrfs => ext4 로 바로 바꿔주는 방법을 찾아야 겠다.


반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,

nginx 로 사이트를 운영중이다. 그런데 다음과 같은 에러가 나온다.

400 Bad Request

Request Header Or Cookie Too Large

nginx/1.6.1

무슨 문제일까?

설정값으로 바꿀 수 있을 것 같은데.


찾았다.

관련글 : http://wiki.nginx.org/HttpCoreModule#large_client_header_buffers

/etc/nginx/nginx.conf 등에 추가한다. http 또는 server 쪽에 넣어준다.

기본값은 4 8k

    large_client_header_buffers 4 16k;

16k 로 늘려줬다. 너무 늘리는 것은 좋지 않겠지.



반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,

CentOS 에서 audit backlog 관련 오류가 난다.

시스템이 이상해서 살펴보니.

dmesg 에 이런 메시지가 나온다.

audit: audit_backlog=321 > audit_backlog_limit=320
audit: audit_lost=2343 audit_rate_limit=0 audit_backlog_limit=320
audit: backlog limit exceeded
audit: audit_backlog=321 > audit_backlog_limit=320
audit: audit_lost=2344 audit_rate_limit=0 audit_backlog_limit=320
audit: backlog limit exceeded
audit: audit_backlog=321 > audit_backlog_limit=320
audit: audit_lost=2345 audit_rate_limit=0 audit_backlog_limit=320
audit: backlog limit exceeded
audit: audit_backlog=321 > audit_backlog_limit=320
__ratelimit: 53 callbacks suppressed
audit: audit_backlog=321 > audit_backlog_limit=320
audit: audit_lost=2364 audit_rate_limit=0 audit_backlog_limit=320
audit: backlog limit exceeded
audit: audit_backlog=321 > audit_backlog_limit=320
audit: audit_lost=2365 audit_rate_limit=0 audit_backlog_limit=320
audit: backlog limit exceeded
audit: audit_backlog=321 > audit_backlog_limit=320
audit: audit_lost=2366 audit_rate_limit=0 audit_backlog_limit=320
audit: backlog limit exceeded
audit: audit_backlog=321 > audit_backlog_limit=320

로그파일쪽 limit 가 걸린 듯 하다. 파일수 제한인가?
log 를 보니 cron 실행과 관련이 있어 보인다.

아무튼 이것때문에 시스템이 이상해졌다.


/etc/init.d/auditd stop

chkconfig auditd off

또는 /etc/audit/audit.rules 를 수정해서 audit_backlog_limit 값을 늘려준다.

-b 320

320이 기본값으로 되어 있다. 그냥 무식하게 0 하나를 더 늘렸다.


centos 에서 selinux 와 함께 audit 요놈도 좀 이상하다.
보안과 관련된 것들일 듯 싶은데, 그에 대한 가이드가 필요할 듯 하다.




반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,