¿ìºÐÅõ dhcpd.conf ¿ÜºÎ ½ÇÇà ¸í·É ¿¡·¯ ¹®ÀÇ µå¸³´Ï´Ù

   Á¶È¸ 9242   Ãßõ 0    

OS : Ubuntu 12.10 64bit
dhcp server : isc-dhcp-server 4.2.4
 
구글링중
 /etc/dhcp/dhcpd.conf 에 on commit 부분이 외부명령 실행
 
subnet 192.168.1.0 netmask 255.255.255.0 {
    option routers  192.168.1.2;

    on commit {
        set clip = binary-to-ascii(10, 8, ".", leased-address);
        set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
        execute("/usr/local/sbin/dhcpevent", "commit", clip, clhw, host-decl-name);
    }
...
 
외부실행 스크립트 예제를 보고 적용 해보려는데, 권한 에러 나고 실행 안되네요,
chmod , chown, chgrp 변경도 해봤음
 
에러 메시지 ( 아래는 tail -f /var/log/syslog 의 메시지 )
 
May 21 09:58:34 iscsi2 dhcpd: Unable to execute /usr/local/sbin/dhcpevent: Permission denied
May 21 09:58:34 iscsi2 dhcpd: execute: /usr/local/sbin/dhcpevent exit status 32512
May 21 09:58:34 iscsi2 kernel: [449057.172797] type=1400 audit(1369097914.551:67): apparmor="DENIED" operation="exec" parent=27235 profile="/usr/sbin/dhcpd" name="/usr/local/sbin/dhcpevent" pid=27240 comm="dhcpd" requested_mask="x" denied_mask="x" fsuid=106 ouid=106
 
 
dhcpevent 스크립트의 내용은 실행 되는지 보려는 데모 스크립트
#!/bin/bash
date=$(date)
echo $date >> /tmp/mylog
echo $0 >> /tmp/mylog
echo $1 >> /tmp/mylog
echo $2 >> /tmp/mylog
ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.
¿¡¾Æºü 2013-05
sudo·Î Çغ¸½Ã¸é ¾ÈµÉ±î¿ä?
ÁåÀåtm 2013-05
´äº¯ °¨»çÇÕ´Ï´Ù~
sudo service isc-dhcp-server restart
service isc-dhcp-server restart
¶È °°³×¿ä, ±¸±Û¸µ ´õ ÇغÁ¾ß °Ú½À´Ï´Ù.
selinux ÄÑÁ®ÀÖÀ¸¸é À̰Ÿ¦ Âü°íÇϼż­ ÀÏ´Ü ²ô°í Çغ¸½ÉÀÌ

http://www.cyberciti.biz/faq/howto-turn-off-selinux/
ÁåÀåtm 2013-05
´äº¯ °¨»çÇÕ´Ï´Ù.
selinux ´Â È°¼ºÈ­ ¾ÈµÇ¾î Àֳ׿ä.
apparmor policy ¿Í ¿¬°üÀÌ ÀÖ´Â°Í °°¾Æ ±¸±Û¸µ ÁßÀÔ´Ï´Ù.
¿¡¾Æºü 2013-05
¼öµµ /À¯Àú/·ÎÄÃ/sºó/dhcpÀ̺¥Æ® ÀÌ·¸°Ô ´Â ¾ÈµÇ·Á³ª¿ä?
ÁåÀåtm 2013-05
´äº¯ °¨»çÇÕ´Ï´Ù.
½ºÅ©¸³Æ® ½ÇÇà ¼º°ø Çß½À´Ï´Ù.
apparmor policy °ü·Ã ¹®Á¦°¡ ¸Â¾Ò³×¿ä.
vi /etc/apparmor.d/usr.sbin.dhcpd Çؼ­
/usr/local/sbin/dhcpevent Uxr, Ãß°¡ ÇØÁÖ°í
/etc/init.d/apparmor reload
service isc-dhcp-server restart
dhcp ¼­¹ö¿¡ client ÀÇ Á¢¼Ó ·Î±× ±â·Ï µË´Ï´Ù.
/tmp/mylog »ý¼º µÇ¾î ÀÖ°í ±â·Ï ³²¾Æ Àֳ׿ä
ÁåÀåtm 2013-05
¹®Á¦°¡ 1°³ ´õ Àִµ¥,
dhcp ¼­¹ö¿Í tftp ¼­¹ö °°ÀÌ ±¸µ¿ ÁßÀε¥,
·Î±×°¡ 2¹ø ³²´Â±º¿ä,
if¹® ¸¸µé¾î¼­ 1¹ø¸¸ ±â·ÏÇÏ°Ô ¸¸µé¸é ³¡À̳׿ä,
´ä±Û ´Þ¾ÆÁÖ½ÅºÐµé °¨»çÇÕ´Ï´Ù.


QnA
Á¦¸ñPage 2737/5684
2015-12   1495081   ¹é¸Þ°¡
2014-05   4958639   Á¤ÀºÁØ1
2012-03   5802   2CPUÃÖÁÖÈñ
2020-01   2642   ±ô¹Ú±ô¹Ú°¡
2008-11   4784   À̹®Èì
2015-08   3745   ¸ÚÁøÄ£±¸
2016-08   3830   bigmaster
2015-08   5125   ¾Æ¸¶Ä«½Ã
2016-08   4489   Ç®·Îµå½Ã½ºÅÛ
2015-08   3691   ±è°Ç¿ì
2003-02   11400   ±èÈñÁß
2014-04   3649   ¹ÌÄ£°¨ÀÚ
2015-08   6649   ÀÌâÁØ
2018-12   5947   ¸Ó¸®°¨ÀÚ
2020-02   3779   ºí·ç¿µ»ó
2005-10   5932   Á¤¼ºÈÆ
2018-12   2819   ¸Þ°¡³¯¹é
2021-05   2333   ¹Ú¹®Çü
2003-02   11918   ÀÌÈ£¿­
2005-11   4983   À±Çö´ö
2014-04   3227   º¸½½ºñ³»¸®¡¦
2017-09   3435   PCMaster