SSHのセッション切れ対策しました♪
SSHで接続しているとき、たまに切れてしまいます。これは以前にも経験していますので、「byobu」を導入して対策します。
1.「byobu」パッケージのインストール(失敗)
pi@Raspyfi:~$ sudo apt-get install byobu
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package byobu
無かった。。。
2.システムをアップデート(RaspyFiで初めて実行)
pi@Raspyfi:~$ sudo apt-get update
Get:1 http://archive.raspbian.org wheezy Release.gpg [490 B]
Get:2 http://archive.raspberrypi.org wheezy Release.gpg [490 B]
Get:3 http://archive.raspbian.org wheezy Release [14.4 kB]
Get:4 http://mirrordirector.raspbian.org wheezy Release.gpg [490 B]
Get:5 http://archive.raspberrypi.org wheezy Release [7,227 B]
Get:6 http://mirrordirector.raspbian.org wheezy Release [14.4 kB]
Get:7 http://archive.raspberrypi.org wheezy/main armhf Packages [16.6 kB]
Get:8 http://archive.raspbian.org wheezy/main Sources [6,260 kB]
Get:9 http://mirrordirector.raspbian.org wheezy/main Sources [6,260 kB]
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Get:10 http://mirrordirector.raspbian.org wheezy/main armhf Packages [7,424 kB]
Get:11 http://archive.raspbian.org wheezy/contrib Sources [52.7 kB]
Get:12 http://archive.raspbian.org wheezy/non-free Sources [97.7 kB]
Get:13 http://archive.raspbian.org wheezy/rpi Sources [569 B]
Get:14 http://archive.raspbian.org wheezy/main armhf Packages [7,424 kB]
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en
Get:15 http://archive.raspbian.org wheezy/contrib armhf Packages [23.3 kB]
Get:16 http://archive.raspbian.org wheezy/non-free armhf Packages [48.0 kB]
Get:17 http://archive.raspbian.org wheezy/rpi armhf Packages [569 B]
Ign http://archive.raspbian.org wheezy/contrib Translation-en_GB
Ign http://archive.raspbian.org wheezy/contrib Translation-en
Ign http://archive.raspbian.org wheezy/main Translation-en_GB
Ign http://archive.raspbian.org wheezy/main Translation-en
Ign http://archive.raspbian.org wheezy/non-free Translation-en_GB
Ign http://archive.raspbian.org wheezy/non-free Translation-en
Ign http://archive.raspbian.org wheezy/rpi Translation-en_GB
Ign http://archive.raspbian.org wheezy/rpi Translation-en
Fetched 27.6 MB in 2min 47s (165 kB/s)
Reading package lists... Done
3.「byobu」パッケージのインストール(再挑戦)
pi@Raspyfi:~$ sudo apt-get install byobu
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
python-newt screen tmux
Suggested packages:
apport po-debconf run-one ttf-ubuntu-font-family update-notifier-common vim
The following NEW packages will be installed:
byobu python-newt screen tmux
0 upgraded, 4 newly installed, 0 to remove and 96 not upgraded.
Need to get 1,110 kB of archives.
After this operation, 2,129 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main tmux armhf 1.6-2 [224 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python-newt armhf 0.52.14-11.1 [100 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main screen armhf 4.1.0~20120320gitdb59704-7 [650 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main byobu all 5.16-1.1 [136 kB]
Fetched 1,110 kB in 2s (431 kB/s)
Preconfiguring packages ...
Selecting previously unselected package tmux.
(Reading database ... 33667 files and directories currently installed.)
Unpacking tmux (from .../archives/tmux_1.6-2_armhf.deb) ...
Selecting previously unselected package python-newt.
Unpacking python-newt (from .../python-newt_0.52.14-11.1_armhf.deb) ...
Selecting previously unselected package screen.
Unpacking screen (from .../screen_4.1.0~20120320gitdb59704-7_armhf.deb) ...
Selecting previously unselected package byobu.
Unpacking byobu (from .../byobu_5.16-1.1_all.deb) ...
Setting up tmux (1.6-2) ...
Setting up python-newt (0.52.14-11.1) ...
Setting up screen (4.1.0~20120320gitdb59704-7) ...
insserv: warning: script 'K02shairport' missing LSB tags and overrides
insserv: warning: script 'shairport' missing LSB tags and overrides
Setting up byobu (5.16-1.1) ...
localepurge: Disk space freed in /usr/share/locale: 0 KiB
localepurge: Disk space freed in /usr/share/man: 0 KiB
Total disk space freed by localepurge: 0 KiB
無事インストール完了!!
4.システムも更新したので再起動
pi@Raspyfi:~$ sudo shutdown -r now
Broadcast message from root@Raspyfi (pts/1) (Thu Jan 16 12:40:57 2014):
The system is going down for reboot NOW!
再接続する。
Linux Raspyfi 3.8.12+ #438 PREEMPT Wed May 8 22:31:10 BST 2013 armv6l
_____ ______ _
| __ \ | ____(_)
| |__) |__ _ ___ _ __ _ _| |__ _
| _ // _` / __| '_ \| | | | __| | |
| | \ \ (_| \__ \ |_) | |_| | | | |
|_| \_\__,_|___/ .__/ \__, |_| |_|
| | __/ |
|_| |___/
Version 1.0 - WWW.RASPYFI.COM
Last login: Thu Jan 16 12:41:32 2014
pi@Raspyfi:~$
無事起動できることを確認。
5.接続する際に自動的に「byobu」を起動する設定
設定前の状態
pi@Raspyfi:~$ ps ax | grep byobu
2805 pts/0 S+ 0:00 grep byobu
設定画面
pi@Raspyfi:~$ exitpi@Raspyfi:~$ byobu-config
メニューで「Byobu currently does not launch at login (toggle on)」を選択
切断して起動の確認
pi@Raspyfi:~$ exit
コンソール画面も華やかになって、「byobu」の起動を確認。
pi@Raspyfi:~$ ps ax | grep byobu
2870 pts/0 S+ 0:00 tmux -2 -f /usr/share/byobu/profiles/tmuxrc
2894 ? Ss 0:00 tmux -2 -f /usr/share/byobu/profiles/tmuxrc
3270 pts/3 S+ 0:00 grep byobu
3273 ? S 0:00 sh -c byobu-status tmux_left
pi@Raspyfi:~$
6.終了状態の復帰の確認
「F6」で終了
再起動すると上記の状態に無事復帰!!
バッチリです(^^)v
0 件のコメント:
コメントを投稿