시간이 나는 대로 IPC 에 관하여 정리하고자 한다.
IPC는 Inter Process Communication 의 약자로써 어쩌구 저쩌구..
자세한 설명은 생략하고 아래 링크로 대체한다.
http://ko.wikipedia.org/wiki/프로세스_간_통신
IPC 도구의 종류로는 대표적으로
1. File
2. Pipe
3. Socket
4. Semaphore
5. Shared memory
등등이 존재한다.
위에 언급되어 있는 놈들은 Primitive 한 녀석들로, kernel 에서 대부분 제공해준다.
저런 애들은 학교에서 거의 배운 것들이고, 제대로 멋지게 사용하려면 심히 귀찮고 어려우니깐..
저것들을 이용해서 만들어 놓은 IPC 고급 구현들의 사용방법을 살펴보고자 한다.
http://techbase.kde.org/index.php?title=Development/Tutorials_(ko)#D-Bus
http://www.freedesktop.org/wiki/Software/dbus/
http://blog.naver.com/PostView.nhn?blogId=lovinghc&logNo=30028862971
위 링크들은 대표적인 고급 구현인 dbus 관련 문서들이다.
dbus 에 대해서 살펴볼 것이다.
우선 나의 맥북에서 dbus를 이용할 수 있는 환경을 만들 수 있는지.. 보자.
sanchoui-MacBook-Air:~ sancho$ brew search dbus
dbus-glib libdbusmenu-qt libmodbus dbus
있다. 과연 설치한 보람이 있는 homebrew 성님...
원조 dbus 와 그것의 glib wrapper 인 dbus-glib 이 존재한다. 두 개 모두 설치 고고씽.
sanchoui-MacBook-Air:~ sancho$ brew install dbus dbus-glib
==> Downloading http://dbus.freedesktop.org/releases/dbus/dbus-1.6.18.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/d-bus/1.6.18 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc --disable-xml-docs --disable-doxygen-docs --enable-launchd --with-launchd-agent-dir=/usr/
==> make
==> make install
==> Caveats
If this is your first install, automatically load on login with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/d-bus/1.6.18/org.freedesktop.dbus-session.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist
If this is an upgrade and you already have the org.freedesktop.dbus-session.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist
cp /usr/local/Cellar/d-bus/1.6.18/org.freedesktop.dbus-session.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist
To have launchd start d-bus at login:
ln -sfv /usr/local/opt/d-bus/*.plist ~/Library/LaunchAgents
Then to load d-bus now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.d-bus.plist
==> /usr/local/Cellar/d-bus/1.6.18/bin/dbus-uuidgen --ensure=/usr/local/var/lib/dbus/machine-id
==> Summary
/usr/local/Cellar/d-bus/1.6.18: 48 files, 2.3M, built in 62 seconds
==> Installing dbus-glib dependency: gettext
==> Downloading http://ftpmirror.gnu.org/gettext/gettext-0.18.3.2.tar.gz
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file gettext-tools/Makefile.in
Hunk #1 succeeded at 1551 (offset 51 lines).
==> ./configure --prefix=/usr/local/Cellar/gettext/0.18.3.2 --with-included-gettext --with-included-glib --with-included-libcroco --with-included-libunistring --with-emacs --disable-java --disable-csharp
==> make
==> make install
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.
OS X provides the BSD gettext library and some software gets confused if both are in the library path.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/gettext/lib
CPPFLAGS: -I/usr/local/opt/gettext/include
==> Summary
/usr/local/Cellar/gettext/0.18.3.2: 375 files, 12M, built in 3.5 minutes
==> Installing dbus-glib
==> Downloading http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.100.2.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/dbus-glib/0.100.2
==> make install
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
/usr/local/Cellar/dbus-glib/0.100.2: 38 files, 1.5M, built in 29 seconds
설치 메시지 중에 이상한 함정이 보이는 것 같다.
dbus 처음 설치하는 놈은 이러저러 해줘야 하고 login 시에 되게 하려면 어쩌구 저쩌구..
모르겠다. 졸립다. 다음 포스팅에~~
'Code' 카테고리의 다른 글
dbus - 2 (0) | 2014.01.23 |
---|---|
Homebrew 설치기 - 2 (0) | 2014.01.03 |
Homebrew 설치기 - 1 (0) | 2014.01.02 |
Build and using glib in Mac os - failed! (0) | 2014.01.02 |
bash shell script #1 (0) | 2013.12.01 |