Linux2009. 11. 20. 15:46
Kernel Threads

Sometimes the process args will be unavailable; when this is happens, ps will instead print the executable name in brackets.

This is correct, try execl(program_path, NULL) and you will see your process listed in brackets.

[링크 : http://www.linuxquestions.org/questions/linux-newbie-8/square-brackets-in-output-of-ps-aux-not-matching-output-of-ps-ejh-716134/]

Low PIDs. Very perceptive of you. Low PIDs usually denote a process started by init on boot

[링크 : http://www.linuxquestions.org/questions/linux-general-1/ps-process-names-in-brackets-644364/]


딱히 이렇다할 편한 대답은 없는데..
아무튼 부팅시에 구동된 낮은 번호의 PID를 지는 프로세스와, (낮은 숫자가 아니어도.. 되긴한다)
 root     29953    11  0 Nov17 ?        00:00:00     [pdflush]
커널 쓰레드가 []를 둘러 싼다고 하는데
 root      1936     1  0 Oct05 ?        00:00:12   [nfsd]

일단은 전반적으로 root가 돌리는 데몬 프로세스 라는 유사성이 있다.
자세한 내용은 나중에 검색해서 추가해야겠다.
Posted by 구차니
Linux2009. 11. 20. 15:26
state     The state is given by a sequence of characters, for example, "RWNA". The first character indicates the run state of the process:

D     Marks a process in disk (or other short term, uninterruptible) wait.
I     Marks a process that is idle (sleeping for longer than about 20 seconds).
L     Marks a process that is waiting to acquire a lock.
R     Marks a runnable process.
S     Marks a process that is sleeping for less than about 20 seconds.
T     Marks a stopped process.
W     Marks an idle interrupt thread.
Z     Marks a dead process (a "zombie").

Additional characters after these, if any, indicate additional state information:

+     The process is in the foreground process group of its control terminal.
<     The process has raised CPU scheduling priority.
E     The process is trying to exit.
J     Marks a process which is in jail(2). The hostname of the prison can be found in /proc/<pid/status>.
L     The process has pages locked in core (for example, for raw I/O).
N     The process has reduced CPU scheduling priority (see setpriority(2)).
s     The process is a session leader.
V     The process is suspended during a vfork(2).
W     The process is swapped out.
X     The process is being traced or debugged.

[링크 : http://www.gsp.com/cgi-bin/man.cgi?section=1&topic=ps]


Posted by 구차니
전 총리가 언어정책이 잘못되었다고 이야기 하다니
자기가 추진한 정책을 자기 입으로 스스로 잘못했다고 하는 저런 용기
그 자체가 부럽다.




우리나라의 영어 우선교육을 바라보면서..
참 씁쓸함이 밀려온다.

[링크 : http://media.daum.net/society/education/view.html?cateid=1012&newsid=20091120103508030&p=yonhap]




2009/11/12 - [개소리 왈왈/직딩의 비애] - "하루늦은" 20091111 퇴근일기

'개소리 왈왈 > 정치관련 신세한탄' 카테고리의 다른 글

통신사 낙시질!  (2) 2009.12.07
기차표가 달라졌어요!  (4) 2009.12.06
한미정상회담 .. 악 MY EYE!  (2) 2009.11.19
확실히 세상은 미쳐가고 있다.  (4) 2009.10.21
그대의 이름은 허본좌!  (2) 2009.10.20
Posted by 구차니
Linux2009. 11. 20. 13:49
#include <sys/param.h>
#include <libutil.h>

struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr);
int pidfile_write(struct pidfh *pfh);
int pidfile_close(struct pidfh *pfh);
int pidfile_remove(struct pidfh *pfh);

[링크 : http://fuse4bsd.creo.hu/localcgi/man-cgi.cgi?pidfile+3]


데몬들은 서비스 관리를 위해서 pid 파일을 가지고 있다.
이녀석은 열어 보면, 단순하게 pid를 %d 로 출력한 내용뿐인데,
일일이 열어서 읽고, atoi 돌리기 귀찮아서 검색을 해보니 pidfile 이라는 함수 패밀리가 있었다.

음. 그런데 die.net에 없는거 보면.. 표준 함수는 아닌건가?
FC6에도 존재하지 않는 함수 -ㅁ-

사족 : 음.. 아마도.. Linux가 아니라 Freebsd Man page 라서 인가?
Posted by 구차니
분류가 모호한 글2009. 11. 20. 09:40
Google Syntax Highlighter와 합쳐
웹에서 프로그래밍을 할 수 있는 웹 프로그램이다.

그래도 웬지 어플은 오프라인에서 해야 제맛? (응?)

[링크 : http://coderunner.tistory.com/]

'분류가 모호한 글' 카테고리의 다른 글

up close and personal  (0) 2009.12.08
기믹(Gimmick)  (0) 2009.11.24
콜론, 콤마, 세미콜론 등등등  (0) 2009.11.17
URI URL URN UNC  (0) 2009.10.27
memcpy 속도 향상에 대한 어셈블리 넘사벽...  (2) 2009.09.07
Posted by 구차니
밥먹고 올라왔더니..

눈앞에 TV에서 그분이 나오셨다. 옆에는 오바바~ 아저씨

"젠장!"




고개를 돌렸더니..

내 자리 TV에서도 그분이 나오셨다.


"닝기리!"





문득 그분의 키가 궁금해졌다.
다음 검색 결과 2007년 대선당시 172cm 라는 글이 있는데..
그럼 오바마는... 190?


근데.. 검색결과 중에
시장시절 175cm
대선당시 172cm

줄어들었다?


... 검색해보니 오바마 190cm 란다 ㄱ-

'개소리 왈왈 > 정치관련 신세한탄' 카테고리의 다른 글

기차표가 달라졌어요!  (4) 2009.12.06
싱가포르가 부럽다  (0) 2009.11.20
확실히 세상은 미쳐가고 있다.  (4) 2009.10.21
그대의 이름은 허본좌!  (2) 2009.10.20
한글날입니다.  (10) 2009.10.09
Posted by 구차니
개소리 왈왈2009. 11. 18. 20:18
...







그냥 잊고 득도 해야하나?

기준을 공개하면 기준에 맞추어 글쓰는 스팸 블로그가 발생한다고 해서 공개는 못한다고 하지만
도무지 그 기준을 종잡을수가 없다.

'개소리 왈왈' 카테고리의 다른 글

와우가 미친게야~  (4) 2009.11.22
토익보러 갑니다!  (12) 2009.11.22
문득 하고 싶은게 생겼다. 해야 할게 생겼다.  (0) 2009.11.17
드디어! 만렙!  (2) 2009.11.14
12:12:12 작성된 글  (0) 2009.11.11
Posted by 구차니
Linux2009. 11. 18. 16:03
if [ -f filename] 으로 파일의 유무를 확인할 수 있다.
물론 그 파일이 존재한다 하더라도 깨어진 심볼릭 링크라면 없는 파일로 나온다.
.. 당연한건가?

$ cat broken_link.sh
#/bin/sh
if [ -f test ]
then
        echo test exist
else
        echo test not exist
fi

$ ls -al
total 60
-r-xr-xr-x 1 morpheuz dev   71 Nov 18 15:37 broken_link.sh
lrwxrwxrwx 1 morpheuz dev    2 Nov 18 15:36 test -> tt

$ ./broken_link.sh
test not exist

$ touch tt
$ ls -al
total 60
-r-xr-xr-x 1 morpheuz dev   71 Nov 18 15:37 broken_link.sh
lrwxrwxrwx 1 morpheuz dev    2 Nov 18 15:36 test -> tt
-rw-rw-r-- 1 morpheuz dev    0 Nov 18 15:40 tt

$ ./broken_link.sh
test exist

[링크 : http://freeos.com/guides/lsst/ch03sec02.html]

'Linux' 카테고리의 다른 글

ps - Process Status  (2) 2009.11.20
pidfile family - pidfile_open, pidfile_remove, pidfile_write, pidfile_close  (0) 2009.11.20
리눅스 셸스크립트 튜토리얼  (2) 2009.11.17
Fedora Core 12  (0) 2009.11.17
UVC - USB Video Class  (0) 2009.11.17
Posted by 구차니
어원은 정확하지 않으나..
국산 국방무기들을 만들때 공돌이들을 갈아넣어 만들어
저렴하고 성능좋은 무기를 단기간에 만들어 냈기에

피탄을 당하거나 문을 열고 닫거나 할때 마다
팅~ 땡그렁~ 끼이익~ 소리 대신
공밀레~ 공밀레~ 한다는 무서운 이야기


사족 : 그러니까 공돌이 + 에밀레 종

[링크 : http://gall.dcinside.com/list.php?id=seafight&no=29515]

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

리눅스 마스터 2급 2차시험  (0) 2009.12.06
학교, 후회  (2) 2009.12.05
게임 개발자는 배가 불렀다?  (4) 2009.11.17
"하루늦은" 퇴근일기 - 20091111  (8) 2009.11.12
2009/09/31 -> 2009/10/31  (2) 2009.10.31
Posted by 구차니
이번에 닥친일은 ethaddr 중 특정 부분을 추출하는 일인데
sed를 써야 하나? shell에서 해야 하나? 이래저래 테스트 하는데..

sh 에서는.. busybox의 ash 라서 그런지 $(string:n:m) 방식의 추출이 되지 않았고
유일하게 되는게 $(string#substr) 로 일치하는 스트링을 삭제하는 것 뿐이었다.
그리고 sed는 .. 라인단위로 하다 보니. 일치하는 문자만을 삭제하려니.. OTL

그런 이유로 tr이라는 녀석이 걸려 나오게 되었다.
tr은 translate or delete characters 라는데.. 도대체 r은 어디서 튀어 나온 녀석일까 ㄱ-




아무튼, uboot 에서 사용하는 예약어인 ethaddr 에서 MAC 부분을 추출하려고 하면
fw_printenv 와 쉘 그리고 tr을 조합하면 된다.

일단 fw_printenv의 값은
 ethaddr=00:00:00:00:00:00
으로 출력되고 이 값을 변수에 넣어준다.

ETH_TEMP=`fw_printenv ethaddr`
ETH_ADDR=echo ${ETH_TEMP#ethaddr=} | tr -d :

그러면 간단하게 ethaddr= 뒤의 MAC 어드레스가 : 없이 나오게 된다.


[링크 : http://k.daum.net/qna/view.html?qid=2f8nN&l_cid=Q&l_st=1] tr
[링크 : http://linux.die.net/man/1/tr] tr man page
[링크 : http://www.faqs.org/docs/abs/HTML/string-manipulation.html]  sh 에서 스트링
[링크 : http://www.ibm.com/developerworks/kr/library/l-sed1.html]      sed 사용법
Posted by 구차니