computerの日記

Cisco,SHELL,C,Qt,C++,Linux,ネットワーク,Windows Scriptなどの発言です

libvirt をインストールして、ホストマシンから仮想マシンのダンプを取得して crash で読んでみる

こんちには、私です。

今日のお題です。

libvirt をインストールして、ホストマシンから仮想マシンのダンプを取得して crash で読んでみる」です。

libvirt をインストールします。

# dnf install libvirt
# dnf install virt-manager
# virt-manager

編集 - ストレージ
を確認すると、/var/lib/libvirt/images となっています。

ちなみに、/ には、50G しか割り当てがありません。これじゃ、仮想マシンを作れません。新しい領域もないので、今あるものを活用したいです。
/home が大きな容量なので、そちらに移したいです。

ちょっとよろしくないかもですが、ユーザつくって、root own にしてみます。

# useradd virt-manager
# chown root:root /home/virt-manager

これで、root が /home/virt-manager を使えます。

デフォルトのストレージパスを変更します。

# virsh
virsh # pool-destroy default
virsh # pool-undefine default
virsh # pool-define-as --name default --type dir --target /home/virt-manager
virsh # pool-autostart default
virsh # pool-build default
virsh # pool-start default
virsh # exit

ストレージパスが、/home/virt-manager になりました。

ただ、これはいい設定とは言えないので、真似しないでくださいね。

以下のファイルを配置します。

/home/virt-manager/CentOS-6.9-x86_64-bin-DVD1.iso
/home/virt-manager/CentOS-6.9-x86_64-bin-DVD2.iso

インストールします。
ドメインは、centos6.9 にしました。
DVDを、入れ替える指示が出たら、以下を実行します(聞かれませんでした)。
# virsh
virsh # attach-disk generic <path-to-iso> <device> --driver file --type cdrom --mode readonly

ここからは、仮想マシンでの作業です。
# rpm -q yum-utils
入っていなければ、yum-utils をインストールします。
# yum install yum-utils

debuginfo パッケージをインストールします。

# debuginfo-install kernel

これで、ホストマシンでゲストマシンのダンプを採取して、そのダンプファイルをゲストマシンに送って crash で読みます。

ここからは、ホストマシンの作業です。巨大になるので、圧縮します。

# virsh dump centos6.9 centos6.9-dump --memory-only --reset --verbose --format kdump-zlib
ダンプ: [100 %]
ドメイン centos6.9 が centos6.9-dump にダンプされました

サイズは、1.2G でした。

ちなみに、--format kdump-zlib を指定しないと、4G越えてました。


これを、仮想マシンに送って、crash で読めるか確認します。
# scp centos6.9-dump root@192.168.122.140:/root

 

ここからは、仮想マシンでの作業です。
# crash centos6.9-dump /usr/lib/debug/lib/modules/2.6.32-696.el6.x86_64/vmlinux
...(snip)...
crash>

読めました。

crash コマンドについては、ここをみるとよいかもですよ。

http://people.redhat.com/anderson/help.html


(参考)
man virsh

お疲れさまです、私でした。次回をお楽しみに。

CentOS 7.4 を VirtualBox に作成して SHIRASAGI-hardening をインストールする方法

minimal をダウンロード。インストールしてから、curl は入っているので、以下でできる。
$ curl -sO https://raw.githubusercontent.com/intrajp/shirasagi-hardening/master/install.sh
# bash install.sh
そして、systemctl get-default として、graphical.target がないので、以下を実行。
# yum -y groupinstall "GNOME Desktop"
# shutdown -r now
# systemctl list-units --type target --all
graphical.target があるので、これを設定する。
# systemctl set-default graphical.target
# shutdown -r now
# yum install kernel-devel
Guest Addition の挿入を実施する。
# shutdown -r now
Firefox を立ち上げる。
http://localhost:3000/.mypage
アカウント:admin
パスワード:pass

SHIRASAGI-hardening を CentOS 7.4 に対応させました

SHIRASAGI-hardening を、CentOS 7.4 に対応させました。
インストールテストもしました。って、それ以上が分からないけど、今度、勉強します。
アカウント:admin
パスワード:pass
で、テストページが表示できましたぁ。

Linux From Scratch (LFS) のスクリプトですが、tarball にしたものを、sourceforge にアップしました

お疲れさまです、私です。

Linux From Scratch (LFS) のスクリプトですが、tarball にしたものを、sourceforge にアップしました。

ファイルは、Version-8.1-systemd.tar.gz です。

これで、カーネルの直前までは行けると思います。

皆さんもやってみてくださいね。

sourceforge.net

何かあればお知らせください。

Linux From Scratch (LFS) のスクリプトですが、PART3 まで移設しました

こんにちは、私 です。

 

Linux From Scratch (LFS) のスクリプトですが、PART3 まで移設しました。

各パッケージの面倒なビルドを、学習効果を損うことなく、半自動化したつもりです。

Grub の設定とカーネルのビルドはご自身で実行してください。

github.com

なにかあればお知らせください。

Linux From Scratch のスクリプトを github に移設中です

お疲れさまです、私です。

 

sourceforge に置いてあった、LFS 用のスクリプトを、github に移設中です。

sourceforge には、バージョン 7.9 用のものを置いていましたが、今回は、8.1 のものに書き直しています。

github.com

今のところ、PART2 まで作っています。

PART3 については、できたらまたお知らせします。

何かありましたら、お知らせください。

私 でした。

次回をお楽しみに。

CentOS 7.3 を CR (Continuous Release) を使って7.4 相当にアップグレード

こんにちは、私です。

以下を参考に、CentOS7.3 を CR(Continuous Release) を使ってアップグレードしてみました。
https://wiki.centos.org/AdditionalResources/Repositories/CR

CentOS 5,6,7 でやり方が異なる。
CentOS 7 の場合、
現在のバージョンを確認する。
# cat /etc/centos-release
CentOS Linux release 7.3.1611 (Core)
まず、すべてをアップデートする。
# yum update
# yum-config-manager --enable cr

# yum repolist
(表示例です)
base
cr
extras
updates
cr/7/x86_64/primary_db
Determining fastest mirrors
* base: ftp.nara.wide.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
repo id repo name status
base/7/x86_64 CentOS-7 - Base 9,363
cr/7/x86_64 CentOS-7 - cr 3,838
extras/7/x86_64 CentOS-7 - Extras 451
updates/7/x86_64 CentOS-7 - Updates 2,146
repolist: 15,798 CentOS-7 - Updates 2,146

となっていればよい。こちらでも確認する。
# cat /etc/yum.repos.d/CentOS-CR.repo
enabled=1
となっていればよい。
では、CentOS7.4 に CR をつかってアップデートする。
# yum update
現在のバージョンを確認する。
# cat /etc/centos-release
CentOS Linux release 7.3.1611 (Core)

7.3 のままだけど、CR としては 7.4 になったということか。

お疲れさまです、私でした。
次回をお楽しみに。

SHIRASAGI-hardening の新たな機能のアイディアについて

お疲れさまです、私 です。

 

SHIRASAGI-hardening のインストーラーは、直していますが、使用されているパッケージが新しくなったりした場合には、きつくなると思いますので、RPM 化を考えています。

 

何かありましたら、お願いします。

 

 

SHIRASAGI-hardening のさらなる修正

SHIRASAGI-hardening インストーラーですが、1度実行していて、2度目に実行しても変にならないように直しました。

その他、さらなる関数化等、取り組んでみました。

何かありましたら、お知らせください。

github.com

CentOS7.3 への VBoxLinuxAdditionsインストール

お疲れさまです、私 です。

 

VirtualBox 上のマシンに、SHIRASAGI-hardening のインストーラーで、shirasagi をインストールしたんですが、画面の解像度がイマイチでした。

 

VBOXADDITIONS のCDマークが出ているので、持ってこなくてもいいのですが、インストールに失敗していました。

cd /var/run/media/xxxx/VBOXADDITIONS_5.1.26_117224/

# ./VBoxLinuxAdditions.run

結果は失敗でした。ログを見ると、KERN_DIR=<kernel> としろと。

# less /var/log/vboxadd-install.log

# yum install kernel-devel

# export KERN_DIR=/usr/src/kernels/3.10.0-514.26.2.el7.x86_64

# ./VBoxLinuxAdditions.run

成功しました。

以上、私 でした。次回をお楽しみに。

 

 

SHIRASAGI-hardening の修正

お疲れさまです。私 です。

 

SHIRASAGI-hardening のインストーラーですが、多少直しました。

コマンドが失敗したら、そこで止まるようにはすでに何ヵ所かしていたのですが、それをもっと増やしてみました。

というのも、あるところでエラーになっていたのに、そのまま先に進んでいるところがあったからです。

イケてないところがまだあるかとは思いますので、何かあれば教えてください。

github.com

お疲れさまです、私 でした。

dbus を使ってみる(その4)

DBusPython Bindings ですが、結構いいですね。

以下のページを見つけました。

DbusExamples - Python Wiki

ここの記述と、d-feet の表示を組み合わせて、データを引っ張ってきたりできました。

これは楽しいです。

また何かわかったら報告します。

dbus を使ってみる(その3)

こんにちは、私です。

DBus を使ってみる実験ですけど、C言語でやることは、けっこう大変みたいです。色んな言語のバインディングがあるみたいですが、最近ちょっと慣れた Pythonバインディングがいいかな、と思いました。

どんなバインディングがあるのかは、以下のリンクを参考にしてください。

翻訳してもいいんですが、怒られそうなので、やめときます。

https://www.freedesktop.org/wiki/Software/DBusBindings/

 

さて、上記リンクをざっと読んだら、早速具体的に試してみたいところです。

また、いいチュートリアルがあるかなと、探してみたところ、以下のリンクを発見しました。まとめ直してもいいんですけど、怒られそうなので、やめときます。

 さて、ここで紹介されているコードを実際に動かしてみたところ、d-feet でキャッチする事ができました。例示されているコードには、作者の名前が埋め込まれているので、これを適宜変えれば、自分のコードとして使えるかもしれません。投げるコードと受けるコードがありますが、投げるコードを投げないと、受けるコードで systrace が出ちゃいます。

これ、みっともないな、と思って調べていたところ、以下のリンクを発見しました。

上記リンクの指示に従ったら、systrace は表示されなくなりました。

このへんをまとめようかと思いましたけど、怒られそうなのでやめときます。

ということで、やりたいことが、見えてきた感じです。

お疲れさまです、本日の実験は終了です。

私でした、次回をお楽しみに。

excid3.com

dbus を使ってみる(その2)

こんにちは、私です。

今日は、ここを見てみました。
http://pkpkbook.eha03.biz/?page_id=3976

さて、自分の端末で、コマンドを叩いてみます。

====
存在するパスの一覧を、配列で取得するコマンドです。

system bus について確認してみます。

$ dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames

(Fedora26 での表示結果です)
method return time=1503147498.801389 sender=org.freedesktop.DBus -> destination=:1.128 serial=3 reply_serial=2
array [
string "org.freedesktop.DBus"
string ":1.128"
string ":1.7"
string ":1.9"
string "org.freedesktop.systemd1"
string "org.fedoraproject.FirewallD1"
string "org.freedesktop.ModemManager1"
string "org.freedesktop.NetworkManager"
string "com.redhat.ifcfgrh1"
string "org.freedesktop.RealtimeKit1"
string "org.freedesktop.Accounts"
string ":1.40"
string ":1.41"
string ":1.64"
string "org.freedesktop.PolicyKit1"
string ":1.43"
string "org.bluez"
string ":1.44"
string ":1.46"
string ":1.24"
string ":1.69"
string ":1.26"
string "fi.epitest.hostap.WPASupplicant"
string "org.freedesktop.Avahi"
string "org.freedesktop.UDisks2"
string "org.fedoraproject.SetroubleshootFixit"
string "fi.w1.wpa_supplicant1"
string "org.freedesktop.login1"
string "org.freedesktop.ColorManager"
string ":1.72"
string ":1.50"
string ":1.73"
string ":1.51"
string "org.freedesktop.DisplayManager"
string ":1.30"
string ":1.31"
string ":1.98"
string "org.freedesktop.problems.daemon"
string ":1.10"
string ":1.32"
string ":1.99"
string ":1.11"
string ":1.33"
string "org.freedesktop.UPower"
string ":1.0"
string ":1.35"
string ":1.1"
string ":1.14"
string ":1.36"
string ":1.37"
string ":1.2"
string ":1.15"
string "org.freedesktop.problems"
string ":1.38"
string ":1.3"
string ":1.16"
string ":1.39"
string ":1.4"
string ":1.17"
string ":1.5"
string ":1.18"
string ":1.6"
string ":1.19"
]

session bus について確認してみます。

$ dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames

(Fedora26 での表示結果です)
method return time=1503147450.719214 sender=org.freedesktop.DBus -> destination=:1.119 serial=3 reply_serial=2
array [
string "org.freedesktop.DBus"
string "org.freedesktop.PowerManagement"
string "org.freedesktop.network-manager-applet"
string "org.freedesktop.systemd1"
string "org.xfce.Terminal5"
string "org.xfce.Xfconf"
string "org.gtk.vfs.mountpoint_2756"
string "org.gtk.vfs.Daemon"
string "org.pulseaudio.Server"
string "org.freedesktop.problems.applet"
string ":1.81"
string "org.xfce.Panel"
string ":1.60"
string ":1.61"
string ":1.62"
string "org.gnome.GConf"
string ":1.63"
string "org.a11y.Bus"
string ":1.41"
string "org.gtk.vfs.UDisks2VolumeMonitor"
string ":1.64"
string ":1.20"
string ":1.42"
string ":1.21"
string ":1.43"
string ":1.66"
string ":1.22"
string ":1.44"
string ":1.23"
string ":1.45"
string ":1.46"
string ":1.69"
string ":1.25"
string "org.xfce.xfdesktop"
string ":1.47"
string ":1.26"
string ":1.48"
string ":1.49"
string ":1.27"
string "org.xfce.PowerManager"
string "org.xfce.FileManager"
string ":1.28"
string "com.redhat.imsettings"
string ":1.29"
string "ca.desrt.dconf"
string "org.freedesktop.ReserveDevice1.Audio0"
string ":1.119"
string "org.PulseAudio1"
string "org.xfce.SessionManager"
string "org.gnome.d-feet"
string ":1.70"
string ":1.71"
string "org.xfce.Thunar"
string "org.blueman.Applet"
string ":1.50"
string ":1.51"
string ":1.74"
string "org.gtk.vfs.Metadata"
string ":1.52"
string ":1.75"
string ":1.53"
string ":1.31"
string ":1.76"
string ":1.32"
string ":1.55"
string ":1.56"
string ":1.57"
string ":1.0"
string ":1.58"
string ":1.36"
string ":1.59"
string "org.xfce.SettingsDaemon"
string ":1.38"
string ":1.4"
string ":1.5"
string "org.freedesktop.IBus"
string ":1.19"
]

====
D-Busの仕様にある標準インターフェースを得る方法です。特定のオブジェクトのインターフェースがXML形式で返却されました。

system bus の検索結果です。

$ dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.Introspectable.Introspect

(Fedora26 での表示結果です)
method return time=1503147306.197404 sender=org.freedesktop.DBus -> destination=:1.127 serial=3 reply_serial=2
string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus">
<method name="Hello">
<arg direction="out" type="s"/>
</method>
<method name="RequestName">
<arg direction="in" type="s"/>
<arg direction="in" type="u"/>
<arg direction="out" type="u"/>
</method>
<method name="ReleaseName">
<arg direction="in" type="s"/>
<arg direction="out" type="u"/>
</method>
<method name="StartServiceByName">
<arg direction="in" type="s"/>
<arg direction="in" type="u"/>
<arg direction="out" type="u"/>
</method>
<method name="UpdateActivationEnvironment">
<arg direction="in" type="a{ss}"/>
</method>
<method name="NameHasOwner">
<arg direction="in" type="s"/>
<arg direction="out" type="b"/>
</method>
<method name="ListNames">
<arg direction="out" type="as"/>
</method>
<method name="ListActivatableNames">
<arg direction="out" type="as"/>
</method>
<method name="AddMatch">
<arg direction="in" type="s"/>
</method>
<method name="RemoveMatch">
<arg direction="in" type="s"/>
</method>
<method name="GetNameOwner">
<arg direction="in" type="s"/>
<arg direction="out" type="s"/>
</method>
<method name="ListQueuedOwners">
<arg direction="in" type="s"/>
<arg direction="out" type="as"/>
</method>
<method name="GetConnectionUnixUser">
<arg direction="in" type="s"/>
<arg direction="out" type="u"/>
</method>
<method name="GetConnectionUnixProcessID">
<arg direction="in" type="s"/>
<arg direction="out" type="u"/>
</method>
<method name="GetAdtAuditSessionData">
<arg direction="in" type="s"/>
<arg direction="out" type="ay"/>
</method>
<method name="GetConnectionSELinuxSecurityContext">
<arg direction="in" type="s"/>
<arg direction="out" type="ay"/>
</method>
<method name="ReloadConfig">
</method>
<method name="GetId">
<arg direction="out" type="s"/>
</method>
<method name="GetConnectionCredentials">
<arg direction="in" type="s"/>
<arg direction="out" type="a{sv}"/>
</method>
<property name="Features" type="as" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/>
</property>
<property name="Interfaces" type="as" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/>
</property>
<signal name="NameOwnerChanged">
<arg type="s"/>
<arg type="s"/>
<arg type="s"/>
</signal>
<signal name="NameLost">
<arg type="s"/>
</signal>
<signal name="NameAcquired">
<arg type="s"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg direction="in" type="s"/>
<arg direction="in" type="s"/>
<arg direction="out" type="v"/>
</method>
<method name="GetAll">
<arg direction="in" type="s"/>
<arg direction="out" type="a{sv}"/>
</method>
<method name="Set">
<arg direction="in" type="s"/>
<arg direction="in" type="s"/>
<arg direction="in" type="v"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg direction="out" type="s"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Monitoring">
<method name="BecomeMonitor">
<arg direction="in" type="as"/>
<arg direction="in" type="u"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Debug.Stats">
<method name="GetStats">
<arg direction="out" type="a{sv}"/>
</method>
<method name="GetConnectionStats">
<arg direction="in" type="s"/>
<arg direction="out" type="a{sv}"/>
</method>
<method name="GetAllMatchRules">
<arg direction="out" type="a{sas}"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="GetMachineId">
<arg direction="out" type="s"/>
</method>
<method name="Ping">
</method>
</interface>
</node>
"
session bus の検索結果です。

$ dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.Introspectable.Introspect

(Fedora26の表示結果です)
method return time=1503147700.526298 sender=org.freedesktop.DBus -> destination=:1.120 serial=3 reply_serial=2
string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus">
<method name="Hello">
<arg direction="out" type="s"/>
</method>
<method name="RequestName">
<arg direction="in" type="s"/>
<arg direction="in" type="u"/>
<arg direction="out" type="u"/>
</method>
<method name="ReleaseName">
<arg direction="in" type="s"/>
<arg direction="out" type="u"/>
</method>
<method name="StartServiceByName">
<arg direction="in" type="s"/>
<arg direction="in" type="u"/>
<arg direction="out" type="u"/>
</method>
<method name="UpdateActivationEnvironment">
<arg direction="in" type="a{ss}"/>
</method>
<method name="NameHasOwner">
<arg direction="in" type="s"/>
<arg direction="out" type="b"/>
</method>
<method name="ListNames">
<arg direction="out" type="as"/>
</method>
<method name="ListActivatableNames">
<arg direction="out" type="as"/>
</method>
<method name="AddMatch">
<arg direction="in" type="s"/>
</method>
<method name="RemoveMatch">
<arg direction="in" type="s"/>
</method>
<method name="GetNameOwner">
<arg direction="in" type="s"/>
<arg direction="out" type="s"/>
</method>
<method name="ListQueuedOwners">
<arg direction="in" type="s"/>
<arg direction="out" type="as"/>
</method>
<method name="GetConnectionUnixUser">
<arg direction="in" type="s"/>
<arg direction="out" type="u"/>
</method>
<method name="GetConnectionUnixProcessID">
<arg direction="in" type="s"/>
<arg direction="out" type="u"/>
</method>
<method name="GetAdtAuditSessionData">
<arg direction="in" type="s"/>
<arg direction="out" type="ay"/>
</method>
<method name="GetConnectionSELinuxSecurityContext">
<arg direction="in" type="s"/>
<arg direction="out" type="ay"/>
</method>
<method name="ReloadConfig">
</method>
<method name="GetId">
<arg direction="out" type="s"/>
</method>
<method name="GetConnectionCredentials">
<arg direction="in" type="s"/>
<arg direction="out" type="a{sv}"/>
</method>
<property name="Features" type="as" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/>
</property>
<property name="Interfaces" type="as" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/>
</property>
<signal name="NameOwnerChanged">
<arg type="s"/>
<arg type="s"/>
<arg type="s"/>
</signal>
<signal name="NameLost">
<arg type="s"/>
</signal>
<signal name="NameAcquired">
<arg type="s"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg direction="in" type="s"/>
<arg direction="in" type="s"/>
<arg direction="out" type="v"/>
</method>
<method name="GetAll">
<arg direction="in" type="s"/>
<arg direction="out" type="a{sv}"/>
</method>
<method name="Set">
<arg direction="in" type="s"/>
<arg direction="in" type="s"/>
<arg direction="in" type="v"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg direction="out" type="s"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Monitoring">
<method name="BecomeMonitor">
<arg direction="in" type="as"/>
<arg direction="in" type="u"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Debug.Stats">
<method name="GetStats">
<arg direction="out" type="a{sv}"/>
</method>
<method name="GetConnectionStats">
<arg direction="in" type="s"/>
<arg direction="out" type="a{sv}"/>
</method>
<method name="GetAllMatchRules">
<arg direction="out" type="a{sas}"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="GetMachineId">
<arg direction="out" type="s"/>
</method>
<method name="Ping">
</method>
</interface>
</node>
"

お疲れさまです。私、でした。
次回をお楽しみに。

dbus を使ってみる(その1)

お疲れさまです、私です。

segatex-ng に何をさせようかと考えていたんですが、dbus に流れている何かのデータをどうにかする、ってのを考えました。

まず、d-feet をインストールしました。

Fedora26 では、簡単にインストールできました。

d-feet を立ち上げて、どんなものがあるのかを、確認しました。

org.freedesktop.Notifications というのがありました。

なんだか分かりませんが、これな何を流しているのか、確認してみようと思いました。

ネットで検索したところ、いいチュートリアルがありました。

cheesehead-techblog.blogspot.jp

ここのサイトをなんとなく翻訳すると、怒られそうで、やらないです。皆さんの方で、じっくり読んんでみてくださいね。

では、やってみます。

やりかたは、d-feet の表示画面であたりをつけて、コマンドを打ってみるやり方です。

org.freedesktop.Notifications が、何かを notify していそうなので、man dbus-send と、紹介したチュートリアルを読んで、自分なりに文法に則り構文を組み立ててみました。

以下のようなコマンドを発行して、このような値が返却されたようです。

$ dbus-send --session --print-reply --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.GetServerInformation

(結果)
method return time=1503141720.720741 sender=:1.100 -> destination=:1.112 serial=21 reply_serial=2
string "Xfce Notify Daemon"
string "Xfce"
string "0.3.6"
string "0.9"

 

なるほど、なんとなくおもしろそうですね。

お疲れさまです。私、でした。

次回をお楽しみに。