systemctl コマンドを使って管理する。その途中で、Raspberry Piならではの発見!
抜群のコストパフォーマンスなので気にしないが全て外部電源に依存しているので、
どっきり!43 years and 0 months ago なんて表示 (3)を参照。
こういう所も、分かって"良い道具"として使います。
最近は、PC、スマートフォンどんどん、性能が良くなっても、性能・機能の1割も使いこなしていないのでは無いでしょうか?
しかし、Raspberry Piは、自分の創造力次第で、性能以上の事ができるコンピュータだ。
創造力の無い人には、単なる「ちょっと、試してみたいデバイス」だが。
しかし、最近の人の歩く姿を見ていると、つくづく思う。 人間は、前を見定めて生きるもの、下(スマホ)をみながら生きるべきではない。
本題のsystemdですが、、、結局 man systemdが一番詳しいので訳しています。
私の場合、ロボットのservice nodeのコンピュターの為に、ちゃんと理解しないとならない。とりあえず、systemctl について簡単に!
(1) UNIT 一覧
(2) UNIT 一覧 error 表示
抜群のコストパフォーマンスなので気にしないが全て外部電源に依存しているので、
どっきり!43 years and 0 months ago なんて表示 (3)を参照。
こういう所も、分かって"良い道具"として使います。
最近は、PC、スマートフォンどんどん、性能が良くなっても、性能・機能の1割も使いこなしていないのでは無いでしょうか?
しかし、Raspberry Piは、自分の創造力次第で、性能以上の事ができるコンピュータだ。
創造力の無い人には、単なる「ちょっと、試してみたいデバイス」だが。
しかし、最近の人の歩く姿を見ていると、つくづく思う。 人間は、前を見定めて生きるもの、下(スマホ)をみながら生きるべきではない。
本題のsystemdですが、、、結局 man systemdが一番詳しいので訳しています。
私の場合、ロボットのservice nodeのコンピュターの為に、ちゃんと理解しないとならない。とりあえず、systemctl について簡単に!
(1) UNIT 一覧
(2) UNIT 一覧 error 表示
(3) UNIT 状態表示
-------------------------------------------------------------------------------------------------
(4) UNIT 開始(start),  停止(stop)
(5) UNIT 自動起動(enable)、停止(disable)
-------------------------------------------------------------------------------------------------
(1) UNIT の一覧  (赤字は、自分の設定)
[root@rcmp-sv01 ~]# systemctl      or     systemdctl --all
UNIT                        LOAD   ACTIVE SUB       DESCRIPTION
proc-sys...t_misc.automount loaded active waiting Arbitrary Executable File Fo
sys-devi...y-ttyAMA0.device loaded active plugged /sys/devices/dev:f1/tty/ttyA
sys-devi...-net-eth0.device loaded active plugged ec00
sys-devi...net-wlan0.device loaded active plugged 802.11_n_WLAN
<略>
dhcpcd@eth0.service loaded active running dhcpcd on eth0
getty@tty1.service loaded active running Getty on tty1
<略>
proc-sys...t_misc.automount loaded active waiting Arbitrary Executable File Fo
sys-devi...y-ttyAMA0.device loaded active plugged /sys/devices/dev:f1/tty/ttyA
sys-devi...-net-eth0.device loaded active plugged ec00
sys-devi...net-wlan0.device loaded active plugged 802.11_n_WLAN
<略>
dhcpcd@eth0.service loaded active running dhcpcd on eth0
getty@tty1.service loaded active running Getty on tty1
<略>
netwifistaticip.service              loaded active exited    Network Connectivity
openntpd.service loaded active running OpenNTP Daemon
openntpd.service loaded active running OpenNTP Daemon
sshd.service                            loaded active running   OpenSSH Daemon
<略>
rdcs-crd.service loaded active running RDCS Coordinator service
rdcs-cpr.service loaded active running RDCS Cooperative service
rdcs-img.service loaded active running RDCS Imaging service
rdcs-wcs.service loaded active running RDCS Work Control Schedule service
rdcs-fr.service loaded active running RDCS Fail safe Recovery service
<略>
rdcs-crd.service loaded active running RDCS Coordinator service
rdcs-cpr.service loaded active running RDCS Cooperative service
rdcs-img.service loaded active running RDCS Imaging service
rdcs-wcs.service loaded active running RDCS Work Control Schedule service
rdcs-fr.service loaded active running RDCS Fail safe Recovery service
rdcs-rc.service                         loaded active running  RDCS Resource Control service
rdcs-sd.service loaded active running RDCS Space Database service
rdcs-log.service loaded active running RDCS Log service
rdcs-rs.service loaded active running RDCS Recognize ing service
syslog.target loaded active active Syslog
rdcs-sd.service loaded active running RDCS Space Database service
rdcs-log.service loaded active running RDCS Log service
rdcs-rs.service loaded active running RDCS Recognize ing service
syslog.target loaded active active Syslog
systemd-...iles-clean.timer loaded active waiting   Daily Cleanup of Temporary D
LOAD = Reflects whether the unit definition was properly loaded.
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
62 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
(2) UNIT の一覧 error 表示
SSH接続なので、下記のエラーが発生しています。
SSH接続なので、下記のエラーが発生しています。
<略>
auditd.service                     error  inactive dead      auditd.service
cronie.service                     loaded active   running   Periodic Command Scheduler
dbus.service                       loaded active   running   D-Bus System Message Bus
dhcpcd@eth0.service        loaded active   running   dhcpcd on eth0
display-manager.service    error  inactive dead      display-manager.service
emergency.service             loaded inactive dead      Emergency Shell
getty@tty1.service             loaded active   running   Getty on tty1
netwifistaticip.service         loaded active   exited    Network Connectivity
openntpd.service                loaded active   running   OpenNTP Daemon
plymouth-quit-wait.service  error  inactive dead      plymouth-quit-wait.service
plymouth-start.service        error  inactive dead      plymouth-start.service
rc-local.service                    error  inactive dead      rc-local.service
<略>
(3) UNITの状態表示 Weakness of Raspberry Pi
ちゃんと、動いています。やっぱり、サーバはstatic IPにしておかないといろいろ大変
下記の表示は、すごく面白い事があります。
何と、43年前から動いている事になっています。 (-_-)???
Raspberry Piは、電源を全て外部電源に依存しています。従って、通常のコンピュータであれば可能な、タイマーの保持ができません。下記のUNITは、固定アドレスでwifiを立上げるUNITの情報です。当然、wifiでネットが立上がってから、ntpdの同期ですから、このような事が発生します。RaspberryPiのコストパフォーマンスを考えれば、ご愛嬌です。その為に、RDCSのシステムでは、対策を実装しました。
ちゃんと、動いています。やっぱり、サーバはstatic IPにしておかないといろいろ大変
下記の表示は、すごく面白い事があります。
何と、43年前から動いている事になっています。 (-_-)???
Raspberry Piは、電源を全て外部電源に依存しています。従って、通常のコンピュータであれば可能な、タイマーの保持ができません。下記のUNITは、固定アドレスでwifiを立上げるUNITの情報です。当然、wifiでネットが立上がってから、ntpdの同期ですから、このような事が発生します。RaspberryPiのコストパフォーマンスを考えれば、ご愛嬌です。その為に、RDCSのシステムでは、対策を実装しました。
[root@rcmp-sv01 ~]# systemctl  status netwifistaticip.service
netwifistaticip.service - Network Connectivity
   Loaded: loaded (/etc/systemd/system/netwifistaticip.service; enabled)
   Active: active (exited) since Thu, 1970-01-01 09:00:08 JST; 43 years and 0 months ago
  Process: 155 ExecStart=/sbin/ip route add default via ${gateway} (code=exited, status=0/SUCCESS)
  Process: 152 ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface} (code=exited, status=0/SUCCESS)
  Process: 126 ExecStart=/usr/sbin/wpa_supplicant -B -Dwext -i${interface} -c/etc/wpa_supplicant/wpa_supplicant.conf (code=exited, status=0/SUCCESS)
  Process: 111 ExecStart=/sbin/ip link set dev ${interface} up (code=exited, status=0/SUCCESS)
   CGroup: name=systemd:/system/netwifistaticip.service
    └─151 /usr/sbin/wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa...
Jan 01 09:00:08 cmp-sv01 systemd[1]: Started Network Connectivity.
(4) UNITの開始(start), 停止(stop)
[root@rcmp-sv01 ~]# systemctl  start netwifistaticip.service
[root@rcmp-sv01 ~]# systemctl stop netwifistaticip.service
[root@rcmp-sv01 ~]# systemctl stop netwifistaticip.service
(5) UNITの自動起動(enable)と、停止(disable)
[root@rcmp-sv01 ~]# systemctl  enable  netwifistaticip.service
[root@rcmp-sv01 ~]# systemctl disable netwifistaticip.service
[root@rcmp-sv01 ~]# systemctl disable netwifistaticip.service
peace!
0 件のコメント:
コメントを投稿