Ubuntu10.04からSysVintの後継であるUpstartが搭載されているので、アプリケーションのデーモン化がすごく簡単になったらしいのでrvm+unicorn_railsなRailsアプリで試してみました。

下記は/etc/init/rails_example.confです。

#!/bin/sh
description "Example ROR3.1 application"

start on runlevel [2345]
stop on runlevel [016]

console owner

exec /var/www/.rvm/bin/rails31_unicorn_rails -c /var/www/example.com/config/unicorn.conf.rb -E production /var/www/example.com/config.ru

respawn

これをおいとくだけで以下の事が出来るようになるらしいです。

# サービスの起動
sudo service rails_example start
# サービスの停止
sudo service rails_example stop
# サービスの状況を確認
sudo service rails_example status
# サービスの再起動
sudo service rails_example resart

実はsudo service rails_example reloadするとUSR2が送られてリロードされてたりするんでしょうか。
確認してないけど十分楽なのでいいのではないでしょうか。

 

標題の通りなんですが、Ubuntu 10.04 LTSをアップデートしたらウェルカムメッセージが2重になって大変気持ち悪い。

具体的には以下のようになっている。

Linux ip-10-170-90-19 2.6.32-314-ec2 #27-Ubuntu SMP Wed Mar 2 22:54:48 UTC 2011 i686 GNU/Linux
Ubuntu 10.04.2 LTS

Welcome to Ubuntu!
 * Documentation:  https://help.ubuntu.com/

  System information as of Tue May 10 09:28:09 UTC 2011

  System load:  0.91              Processes:           100
  Usage of /:   33.8% of 7.87GB   Users logged in:     0
  Memory usage: 8%                IP address for eth0: 10.170.175.104
  Swap usage:   0%

  Graph this data and manage this system at https://landscape.canonical.com/
---------------------------------------------------------------------
At the moment, only the core of the system is installed. To tune the
system to your needs, you can choose to install one or more
predefined collections of software by running the following
command:                                                             

   sudo tasksel --section server
---------------------------------------------------------------------

Ubuntu 10.04.2 LTS

Welcome to Ubuntu!
 * Documentation:  https://help.ubuntu.com/

  System information as of Tue May 10 09:24:16 UTC 2011

  System load:  0.0               Processes:           87
  Usage of /:   32.4% of 7.87GB   Users logged in:     0
  Memory usage: 58%               IP address for eth0: 10.170.175.104
  Swap usage:   0%

  Graph this data and manage this system at https://landscape.canonical.com/
---------------------------------------------------------------------
At the moment, only the core of the system is installed. To tune the
system to your needs, you can choose to install one or more
predefined collections of software by running the following
command:                                                             

   sudo tasksel --section server
---------------------------------------------------------------------

8 packages can be updated.
6 updates are security updates.

*** System restart required ***
Last login: Tue May 10 09:24:20 2011 from example.com

要するに、新しいウェルカムメッセージが表示された後にアップデート前に出ていたウェルカムメッセージが続けて表示されてしまっておるわけですね。気持ち悪い。

ウェルカムメッセージを表示しているmotdの仕様変更か何からしいです。

/etc/motd.tailをcatしてみるとわかるんですが、古いウェルカムメッセージがそのまま保存されっ放しになっておるのが原因なので、以下のようにすれば直ります。

$ sudo mv -f /etc/motd.tail /etc/motd.tail.org
 

会社のメインマシンをubuntu9.10に変えました。
理由は、MS製品のライセンスの管理やらにうんざりしたのと、本格的にruby on railsで開発をしてみようと思い立ったから。

java出身のエンジニアの方は、eclipseでの開発に慣れてるのではないでしょうか。
私もその一人で、普段使わなくても、eclipseは必ず入ってます。
ubuntu9.10になったメインマシンにもeclipse+pleiadesで環境を作ろうかと思ったのですが、小一時間躓いたのでメモ。

まず、eclipseはapt-getでインストールします。

$ sudo apt-get install eclipse

インストールしたら、pleiadesのサイト(http://mergedoc.sourceforge.jp/)からpleiades本体をダウンロードします。
最新版、安定版は好みの問題ですが、今回は安定版を選びました。
次に、ダウンロードしたファイル(pleiades_1.3.1.zip)を/usr/lib/eclipseに展開します。
最後に、/usr/lib/eclipse/eclipse.iniを編集し、最後の行に

-javaagent:/usr/lib/eclipse/plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar

を追加します。
windowsや他のlinuxと違うのは、pleiades.jarのファイルをフルパス指定するところでしょうか。
ここまで来たら、一度-cleanをつけてeclipse起動します。

$ eclipse -clean

うまく起動できたら、次回からはランチャからの起動でOKです。

© 2011 sanojimaru.com Suffusion theme by Sayontan Sinha