리눅스 log 명령어를 아시는 분 계신가요?

anyjava의 이미지

리눅스 log 명령어를 아시는 분 계신가요?

스트립트 안에 log명령이 있는데...
인터넷에서도 못 찾겠습니다.

PCMCIA에서 CF카드를 serial로 설정하는 부분입니다만,
/etc/pcmcia/serial 파일의 내용중에

cd /dev ; log ./MAKEDEV $DEVICE

부분이 있는데 이 log 명령을 구할 수가 없습니다.

이 명령에 대해 아시는 분의 조언을 구합니다.

/etc/pcmcia/serial 파일
#!/bin/sh
#
# serial 1.42 2002/06/25 06:15:10 (David Hinds)
#
# Initialize or shutdown a PCMCIA serial device
#
# The first argument should be either 'start' or 'stop'. The second
# argument is the base name for the device.
#
# The script passes an extended device address to 'serial.opts' in the
# ADDRESS variable, to retrieve device-specific configuration options.
# The address format is "scheme,socket,instance" where "scheme" is the
# PCMCIA configuration scheme, "socket" is the socket number, and
# "instance" is used to number multiple ports on a single card.
#

if [ -r ./shared ] ; then . ./shared ; else . /etc/pcmcia/shared ; fi

# Get device attributes
get_info $DEVICE

# Load site-specific settings
ADDRESS="$SCHEME,$SOCKET,$INSTANCE"
start_fn () { return; }
stop_fn () { return; }
. $0.opts

# Newer kernels deprecate use of "cua" devices, but we need to
# keep track of them anyway, if the device files are present
NR=`expr $MINOR - 64`
if [ -c /dev/cua1 ] ; then
CALLOUT=cua$NR
else
CALLOUT=$DEVICE
fi

case "$ACTION" in

'start')
[ -n "$VERBOSE" -a -n "$INFO" ] && echo "$INFO"
if [ ! -c /dev/$DEVICE ] ; then
cd /dev ; log ./MAKEDEV $DEVICE
fi
if [ -n "$LINK" ] ; then
if [ -L $LINK ] ; then rm $LINK ; fi
if match `uname -r` "2.[2345].*" ; then
ln -s /dev/$DEVICE $LINK
else
ln -s /dev/$CALLOUT $LINK
fi
fi
if [ -x /bin/setserial ] ; then
# Workaround for serial driver bug
IRQ=`setserial /dev/$DEVICE | sed -e 's/.*IRQ: //'`
setserial /dev/$DEVICE irq 0 ; setserial /dev/$DEVICE irq $IRQ
if [ -n "$SERIAL_OPTS" ] ; then
log setserial /dev/$DEVICE $SERIAL_OPTS
fi
fi
if [ -n "$INITTAB" ] ; then
echo "S$NR:12345:respawn:$INITTAB $DEVICE" >> /etc/inittab
telinit q
fi
start_fn $DEVICE
;;

'check')
is_true $NO_CHECK && exit 0
if [ -n "$INITTAB" ] ; then
do_fuser -v /dev/$DEVICE /dev/$CALLOUT $LINK | grep -v getty \
| grep -q /dev/$DEVICE && exit 1
else
do_fuser -s /dev/$DEVICE /dev/$CALLOUT $LINK && exit 1
fi
;;

'cksum')
chk_simple "$NEW_SCHEME,$SOCKET,$INSTANCE" || exit 1
;;

'stop')
if [ -n "$INITTAB" ] ; then
grep -v $DEVICE /etc/inittab > /etc/inittab.new
mv /etc/inittab.new /etc/inittab
telinit q
fi
do_fuser -k /dev/$DEVICE /dev/$CALLOUT $LINK > /dev/null
if [ -L "$LINK" ] ; then rm $LINK ; fi
stop_fn $DEVICE
;;

'suspend')
do_fuser -k -STOP /dev/$DEVICE /dev/$CALLOUT > /dev/null
;;

'resume')
if [ -n "$SERIAL_OPTS" ] ; then
setserial /dev/$DEVICE $SERIAL_OPTS
fi
do_fuser -k -CONT /dev/$DEVICE /dev/$CALLOUT $LINK > /dev/null
;;

*)
usage
;;

esac

exit 0

codebank의 이미지

log라는 명령어는 없습니다.
log는 shell에서 정의해서 사용하는 함수입니다.
해당함수는 /etc/pcmcia/shared 에 정의되어있습니다.
if [ -r ./shared ] ; then . ./shared ; else . /etc/pcmcia/shared ; fi
스크립트 첫번째 명령줄을 보시면 그 부분을 첨가시키는(실행 시키는 부분입니다.)
부분이 있습니다.
즉, 위 라인에서 shared라는 파일을 실행시켜서 지정된 함수들을 활성화시키는 것입니다.
serial의 코드는
http://sunsite.bilkent.edu.tr/pub/linux/mandrake/9.1/i586/Mandrake/mdkinst/etc/pcmcia/serial
를 참고했고 log함수가 정의되어있는 shared는
http://sunsite.bilkent.edu.tr/pub/linux/mandrake/9.1/i586/Mandrake/mdkinst/etc/pcmcia/shared
를 참고 했습니다.

------------------------------
좋은 하루 되세요.

anyjava의 이미지

log 함수가 shared에 있는 것을 못 찾았군요.

MAKEDEV가 스크립트 인가 했더니

/sbin/MAKEDEV 명령이 있군요.

감사합니다.

커널을 정복 할때 까지...

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.