<p>poudriereλŠ” 감μ˜₯μ—μ„œ μΌν•˜μ§€ μ•ŠλŠ”λ‹€</p>

에 λ§Œλ“  2014λ…„ 09μ›” 18일  Β·  8μ½”λ©˜νŠΈ  Β·  좜처: freebsd/poudriere

감μ˜₯ λ‚΄μ—μ„œ poudriere λŒ€λŸ‰μ„ μ‹œμž‘ν•˜λŠ” 것은 λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€.

# poudriere bulk -f /usr/local/etc/poudriere.d/ports-lists/Kunden-Ports -j Kunden

[00:00:00] ====>> Creating the reference jail... done
[00:01:04] ====>> Mounting system devices for Kunden-default
[00:01:04] ====>> Mounting ports/packages/distfiles
[00:01:04] ====>> Using packages from previously failed build
[00:01:04] ====>> Mounting packages from: /poudriere/data/packages/Kunden-default
[00:01:04] ====>> Mounting /var/db/ports from: /usr/local/etc/poudriere.d/Kunden-options
[00:01:04] ====>> Appending to make.conf: /usr/local/etc/poudriere.d/Kunden-make.conf
/etc/resolv.conf -> /poudriere/data/.m/Kunden-default/ref/etc/resolv.conf
[00:01:04] ====>> Starting jail Kunden-default
jail: jail_set: Operation not permitted
[00:01:04] ====>> Cleaning up
[00:01:04] ====>> Umounting file systems

μ΅œλŒ€ν•œ μœ„ν‚€ ν•­λͺ©μ„ λ”°λžμ§€λ§Œ ZFSλŠ” μ‚¬μš©ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. λ”°λΌμ„œ 감μ˜₯에 λŒ€ν•œ λ‚΄ FreeBSD 10 ꡬ성은 λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

poudriere {
  path="/usr/local/jail/poudriere";
  host.hostname="poudriere";
  ip6.addr="2a01:4f8:150:50a5::12/64";
        persist;
        children.max=99;
        allow.mount;
        allow.mount.devfs;
        allow.mount.procfs;
        allow.mount.zfs;
        allow.mount.nullfs;
        allow.mount.tmpfs;
        allow.raw_sockets;
        allow.socket_af;
        allow.sysvipc;
        allow.chflags;
        mount.devfs;
        enforce_statfs=1; 
  interface=re0;
  exec.start = "/bin/sh /etc/rc";
  exec.stop = "/bin/sh /etc/rc.shutdown";

}

였λ₯˜ λ©”μ‹œμ§€λŠ” 감μ˜₯ 내에 감μ˜₯을 λ§Œλ“€ 수 μ—†μŒμ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€. κ·ΈλŸ¬λ―€λ‘œ λ‚˜λŠ” 그것을 μˆ˜λ™μœΌλ‘œ μ‹œλ„ν–ˆλ‹€ - λ‚˜λŠ” jail-poudriere μ•ˆμ— 감μ˜₯을 λ§Œλ“€ 수 μ—†λ‹€.

IPv6이 μžˆλŠ” 경우 μΆ”κ°€ ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•΄ 감μ˜₯에 μ•‘μ„ΈμŠ€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Code_Defect Imported bug

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

이번 ν˜Έμ—μ„œ μ„€λͺ…ν•˜λŠ” λ¬Έμ œλŠ” Poudriereκ°€ μ•„λ‹ˆλΌ FreeBSD 감μ˜₯의 섀계와 관련이 μžˆμŠ΅λ‹ˆλ‹€.

문제/였λ₯˜

[00:00:00] ====>> Creating the reference jail... done
[00:00:04] ====>> Mounting system devices for 10-1R_amd64-default
[00:00:04] ====>> Mounting ports/packages/distfiles
[00:00:04] ====>> Using packages from previously failed build
[00:00:04] ====>> Mounting packages from: /poudriere/data/packages/10-1R_amd64-default
[00:00:04] ====>> Appending to make.conf: /usr/local/etc/poudriere.d/10-1R_amd64-make.conf
/etc/resolv.conf -> /poudriere/data/.m/10-1R_amd64-default/ref/etc/resolv.conf
[00:00:04] ====>> Starting jail 10-1R_amd64-default
jail: jail_set: Operation not permitted
[00:00:04] ====>> Cleaning up
[00:00:04] ====>> Umounting file systems

μ„€λͺ…

man jail :

Jailed ν”„λ‘œμ„ΈμŠ€λŠ” μžμ‹ λ³΄λ‹€ 더 큰 κΆŒν•œμ„ λΆ€μ—¬ν•  수 μ—†μŠ΅λ‹ˆλ‹€.
예λ₯Ό λ“€μ–΄, allow.nomountλ₯Ό μ‚¬μš©ν•˜μ—¬ 감μ˜₯을 λ§Œλ“  경우
allow.mountκ°€ μ„€μ •λœ 감μ˜₯을 λ§Œλ“€ 수 μ—†μŠ΅λ‹ˆλ‹€. μœ μ‚¬ν•˜κ²Œ, κ·ΈλŸ¬ν•œ
ip4.addr 및 securelevelκ³Ό 같은 μ œν•œμ€ μžμ‹μ—μ„œ μš°νšŒν•  수 μ—†μŠ΅λ‹ˆλ‹€.
감μ˜₯.

λ”°λΌμ„œ IP μ£Όμ†Œ 127.0.0.1 및 ::1 λ₯Ό μ •μ˜ν•΄μ•Ό ν•©λ‹ˆλ‹€.
loopback μΈν„°νŽ˜μ΄μŠ€ lo0 슈퍼 감μ˜₯ μ‹œμŠ€ν…œ(Poudriere 감μ˜₯). λ‹€λ₯Έ IP μ£Όμ†Œλ„ λ§ˆμ°¬κ°€μ§€μž…λ‹ˆλ‹€. 슈퍼 감μ˜₯에 λŒ€ν•΄ μ„€μ •λœ 계측적 감μ˜₯μ—λ§Œ IPλ₯Ό μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

ν…ŒμŠ€νŠΈ(10.1-STABLEμ—μ„œ)

μ‹€ν–‰ν•˜λ©΄ μœ„μ—μ„œ μ„€λͺ…ν•œ 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€.

# jail -c persist 'name=10-1R_amd64-default' \ 
'path=/poudriere/data/.m/10-1R_amd64-default/ref' \ 
'host.hostname=10-1R_amd64-default' \ 
'ip4.addr=127.0.0.1'  'ip6.addr=::1' \ 
allow.socket_af allow.raw_sockets allow.chflags allow.sysvipc

μ•„λž˜ μ½”λ“œλ₯Ό μ‹€ν–‰ν•˜λ©΄ 문제 없이 μ§„ν–‰λ©λ‹ˆλ‹€.
'ip4.addr=127.0.0.1' 'ip6.addr=::1' λ§€κ°œλ³€μˆ˜κ°€ 제거됨):

# jail -c persist 'name=10-1R_amd64-default' \ 
'path=/poudriere/data/.m/10-1R_amd64-default/ref' \ 
'host.hostname=10-1R_amd64-default' \ 
allow.socket_af allow.raw_sockets allow.chflags allow.sysvipc

λΌμΈμ—μ„œ ${network} λ³€μˆ˜λ₯Ό μ œκ±°ν•˜μ—¬ ν…ŒμŠ€νŠΈλ₯Ό μž¬ν˜„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
/usr/local/share/poudriere/common.sh 쀑 252

μ†”λ£¨μ…˜( ezjail μ—λ§Œ ν•΄λ‹Ήν•˜μ§€λ§Œ /etc/jail.conf 에도 λ™μΌν•œ 방법을 μ μš©ν•  수 있음)

127.0.0.1,::1 λ₯Ό 감μ˜₯ IP λͺ©λ‘μ— μΆ”κ°€ν•©λ‹ˆλ‹€.
/usr/local/etc/ezjail/myjail_example_org :

export jail_myjail_example_org_ip="em0|192.168.3.6,lo0|127.0.0.1,lo0|::1"

λͺ¨λ“  8 λŒ“κΈ€

μ•„λ§ˆλ„ 'ip4' ν•­λͺ©μ΄ μ—†μ–΄μ„œ μ‹€νŒ¨ν–ˆμ„ κ²ƒμž…λ‹ˆλ‹€. 'poudriere -x bulk ... 2>log'λ₯Ό μ‹€ν–‰ν•˜κ³  둜그 νŒŒμΌμ„ μ—…λ‘œλ“œν•˜κ±°λ‚˜ λ‚΄κ°€ λ³Ό 수 μžˆλŠ” μœ„μΉ˜μ— ν˜ΈμŠ€νŒ…ν•  수 μžˆμŠ΅λ‹ˆκΉŒ?

μ—¬κΈ°μ—μ„œ 둜그λ₯Ό λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.
http://pkg.toco-domains.de/poudriere-in-jail-error.log

"ip4=inherit;ip6=inherit;"으둜 μ œμ•ˆμ„ μ‹œλ„ν–ˆμŠ΅λ‹ˆλ‹€. λ§žμŠ΅λ‹ˆλ‹€. 이 μ˜΅μ…˜μ„ μ„€μ •ν•˜λ©΄ μž‘λ™ν•©λ‹ˆλ‹€. :)

"μž‘λ™"μ΄λž€ λ‹€μŒμ„ μ˜λ―Έν•©λ‹ˆλ‹€.
였λ₯˜ λ©”μ‹œμ§€κ°€ μ‚¬λΌμ‘ŒμŠ΅λ‹ˆλ‹€. μ‚¬μš©ν•  IPv4 μ£Όμ†Œκ°€ μ—†κΈ° λ•Œλ¬Έμ— 포트 ꡬ좕을 ν…ŒμŠ€νŠΈν•  수 μ—†μŠ΅λ‹ˆλ‹€. poudriereκ°€ 포트λ₯Ό κ°€μ Έμ˜€μ§€ λͺ»ν•©λ‹ˆλ‹€. IPv4λ₯Ό 톡해 κ°•μ œλ‘œ λ‹€μš΄λ‘œλ“œν•˜λŠ” 것 κ°™μŠ΅λ‹ˆκΉŒ?

둜그λ₯Ό 보고 μžˆμŠ΅λ‹ˆλ‹€. λ‹€μŒ μ€„μ—μ„œ 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€.

jail -c persist name=Kunden-default path=/poudriere/data/.m/Kunden-default/ref host.hostname=Kunden-default ip4.addr=127.0.0.1 ip6.addr=::1 allow.socket_af allow.raw_sockets allow.chflags allow.sysvipc

행을 λ‹€μŒκ³Ό 같이 λ³€κ²½ν•˜λŠ” 경우:

jail -c persist name=Kunden-default path=/mnt/ host.hostname=Kunden-default ip6.addr=2a01:4f8:150:50a5::12 allow.socket_af allow.raw_sockets allow.chflags allow.sysvipc

감μ˜₯이 μ„±κ³΅μ μœΌλ‘œ μƒμ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ λ‚˜λŠ” κ·Έκ²ƒμœΌλ‘œ 일할 수 μžˆμŠ΅λ‹ˆλ‹€. 이게 도움이 되길 λ°”λž€λ‹€.

λͺ¨λ“  μž‘μ—…μ— κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€ :)

ν•˜λ“œμ½”λ”©λœ IPv6 μ£Όμ†Œλ₯Ό μ„€μ •ν•œ ν›„ 포트 ꡬ좕이 μ‹œμž‘λ©λ‹ˆλ‹€.

κ·ΈλŸ¬λ‚˜ pkg-packageλ₯Ό μ»΄νŒŒμΌν•œ 직후에 μ€‘μ§€λ©λ‹ˆλ‹€. μ—λŸ¬ λ©”μ‹œμ§€:

=== μ‹œμž‘ ===

====> 맀뉴얼 νŽ˜μ΄μ§€ μ••μΆ•(compress-man)

========================= ===> pkg-1.3.5.1용 νŒ¨ν‚€μ§€ λΉŒλ“œ
pkg-static: "/var/run/ld-elf.so.hints"λ₯Ό μ—΄ 수 μ—†μŒ: ν•΄λ‹Ή νŒŒμΌμ΄λ‚˜ 디렉터리가 μ—†μŠ΅λ‹ˆλ‹€.
*** 였λ₯˜ μ½”λ“œ 1

λ©ˆμΆ”λ‹€.
make[1]: /usr/ports/ports-mgmt/pkgμ—μ„œ 쀑지됨
*** 였λ₯˜ μ½”λ“œ 1

λ©ˆμΆ”λ‹€.
make: /usr/ports/ports-mgmt/pkgμ—μ„œ 쀑지됨
====>> wrkdir 정리
===> pkg-1.3.5.1 μ²­μ†Œ
/usr/ports/ports-mgmt/pkg λΉŒλ“œκ°€ 2014λ…„ 8μ›” 11일 μ›” 08:35:21 UTC에 μ’…λ£Œλ¨
λΉŒλ“œ μ‹œκ°„: 00:00:30
!!! λΉŒλ“œ μ‹€νŒ¨κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€!!!
[ root@poudriere /]# ls -lah /var/run/ld-elf.so.hints

=== 끝 ===

파일이 μ‘΄μž¬ν•©λ‹ˆλ‹€.

ls -lah /var/run/ld-elf.so.hints

-r--r--r-- 1 루트 휠 199B 8μ›” 6일 13:58 /var/run/ld-elf.so.hints

κ·Έλž˜μ„œ λ‚˜λŠ” 그것이 μ˜¬λ°”λ₯΄κ²Œ λ³΅μ‚¬λ˜μ§€ μ•Šμ•˜λ‹€κ³  μƒκ°ν•©λ‹ˆκΉŒ?

디버깅 ν›„ μ—˜ν”„ νžŒνŠΈμ— λ¬Έμ œκ°€ μžˆμŒμ„ λ°œκ²¬ν–ˆμŠ΅λ‹ˆλ‹€. μ°Έμ‘° 감μ˜₯을 λ§Œλ“€ λ•Œ 감μ˜₯에 λŒ€ν•œ κ²½λ‘œλŠ” 볡사에 μ‚¬μš©λ©λ‹ˆλ‹€.

제 κ²½μš°μ—λŠ” /usr/local/jail/poudriere/var/run -> 이며 이 κ²½λ‘œλŠ” 감μ˜₯ λ‚΄μ—μ„œ μ‘΄μž¬ν•˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.
μ €λ₯Ό μœ„ν•œ ν•΄κ²° λ°©λ²•μœΌλ‘œ /var/run의 볡사λ₯Ό ν•˜λ“œμ½”λ”©ν–ˆμŠ΅λ‹ˆλ‹€. 이것은 μž‘λ™ν•˜λŠ” 것 κ°™μŠ΅λ‹ˆλ‹€ :)

이번 ν˜Έμ—μ„œ μ„€λͺ…ν•˜λŠ” λ¬Έμ œλŠ” Poudriereκ°€ μ•„λ‹ˆλΌ FreeBSD 감μ˜₯의 섀계와 관련이 μžˆμŠ΅λ‹ˆλ‹€.

문제/였λ₯˜

[00:00:00] ====>> Creating the reference jail... done
[00:00:04] ====>> Mounting system devices for 10-1R_amd64-default
[00:00:04] ====>> Mounting ports/packages/distfiles
[00:00:04] ====>> Using packages from previously failed build
[00:00:04] ====>> Mounting packages from: /poudriere/data/packages/10-1R_amd64-default
[00:00:04] ====>> Appending to make.conf: /usr/local/etc/poudriere.d/10-1R_amd64-make.conf
/etc/resolv.conf -> /poudriere/data/.m/10-1R_amd64-default/ref/etc/resolv.conf
[00:00:04] ====>> Starting jail 10-1R_amd64-default
jail: jail_set: Operation not permitted
[00:00:04] ====>> Cleaning up
[00:00:04] ====>> Umounting file systems

μ„€λͺ…

man jail :

Jailed ν”„λ‘œμ„ΈμŠ€λŠ” μžμ‹ λ³΄λ‹€ 더 큰 κΆŒν•œμ„ λΆ€μ—¬ν•  수 μ—†μŠ΅λ‹ˆλ‹€.
예λ₯Ό λ“€μ–΄, allow.nomountλ₯Ό μ‚¬μš©ν•˜μ—¬ 감μ˜₯을 λ§Œλ“  경우
allow.mountκ°€ μ„€μ •λœ 감μ˜₯을 λ§Œλ“€ 수 μ—†μŠ΅λ‹ˆλ‹€. μœ μ‚¬ν•˜κ²Œ, κ·ΈλŸ¬ν•œ
ip4.addr 및 securelevelκ³Ό 같은 μ œν•œμ€ μžμ‹μ—μ„œ μš°νšŒν•  수 μ—†μŠ΅λ‹ˆλ‹€.
감μ˜₯.

λ”°λΌμ„œ IP μ£Όμ†Œ 127.0.0.1 및 ::1 λ₯Ό μ •μ˜ν•΄μ•Ό ν•©λ‹ˆλ‹€.
loopback μΈν„°νŽ˜μ΄μŠ€ lo0 슈퍼 감μ˜₯ μ‹œμŠ€ν…œ(Poudriere 감μ˜₯). λ‹€λ₯Έ IP μ£Όμ†Œλ„ λ§ˆμ°¬κ°€μ§€μž…λ‹ˆλ‹€. 슈퍼 감μ˜₯에 λŒ€ν•΄ μ„€μ •λœ 계측적 감μ˜₯μ—λ§Œ IPλ₯Ό μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

ν…ŒμŠ€νŠΈ(10.1-STABLEμ—μ„œ)

μ‹€ν–‰ν•˜λ©΄ μœ„μ—μ„œ μ„€λͺ…ν•œ 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€.

# jail -c persist 'name=10-1R_amd64-default' \ 
'path=/poudriere/data/.m/10-1R_amd64-default/ref' \ 
'host.hostname=10-1R_amd64-default' \ 
'ip4.addr=127.0.0.1'  'ip6.addr=::1' \ 
allow.socket_af allow.raw_sockets allow.chflags allow.sysvipc

μ•„λž˜ μ½”λ“œλ₯Ό μ‹€ν–‰ν•˜λ©΄ 문제 없이 μ§„ν–‰λ©λ‹ˆλ‹€.
'ip4.addr=127.0.0.1' 'ip6.addr=::1' λ§€κ°œλ³€μˆ˜κ°€ 제거됨):

# jail -c persist 'name=10-1R_amd64-default' \ 
'path=/poudriere/data/.m/10-1R_amd64-default/ref' \ 
'host.hostname=10-1R_amd64-default' \ 
allow.socket_af allow.raw_sockets allow.chflags allow.sysvipc

λΌμΈμ—μ„œ ${network} λ³€μˆ˜λ₯Ό μ œκ±°ν•˜μ—¬ ν…ŒμŠ€νŠΈλ₯Ό μž¬ν˜„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
/usr/local/share/poudriere/common.sh 쀑 252

μ†”λ£¨μ…˜( ezjail μ—λ§Œ ν•΄λ‹Ήν•˜μ§€λ§Œ /etc/jail.conf 에도 λ™μΌν•œ 방법을 μ μš©ν•  수 있음)

127.0.0.1,::1 λ₯Ό 감μ˜₯ IP λͺ©λ‘μ— μΆ”κ°€ν•©λ‹ˆλ‹€.
/usr/local/etc/ezjail/myjail_example_org :

export jail_myjail_example_org_ip="em0|192.168.3.6,lo0|127.0.0.1,lo0|::1"

슈퍼 였래된 버그가 λ°•μ‚΄λ‚¬μŠ΅λ‹ˆλ‹€!

c756e1822013a763c8a5e4ccee273794bd182e11도 도움이 λ©λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰