2013年5月4日星期六

树莓派折腾记录:花生壳和语盒 yuchberry 服务器

花生壳用 http 协议 + cron 更新 ip 地址(我算是编译程序会死星人,在台式机上编译出客户端试了一下太复杂懒得折腾)
sudo crontab -e ,内容是
*/2 * * * * wget -qO- http://user:password@ddns.oray.com/ph/update?hostname=&myip=
hostname为空是更新全部,ip为空是自动获取……

语盒 yuchberry 服务器
参照 http://www.shumeipai.net/read.php?tid-935.html
花生壳见上
sudo apt-get install openjdk-7-jdk
下载语盒服务器程序 http://yuchberry.googlecode.com/files/yuchsbox_server_1.12.1833.zip
具体配置,请参照语盒的 WIKI http://code.google.com/p/yuchberry/wiki/FAQ?tm=6
运行语盒: java -jar svr.jar

开机启动
参考 http://1024.me/setup-yuchs-for-push-mail-on-debian-vps/ ,照做会提示 missing LSB information ,所以我就自己加上啦~另外似乎推荐用 insserv 而不是 update-rc.d ?
开机自启的脚本 yuchberry.sh 内容为:
========
#!/bin/bash

### BEGIN INIT INFO
# Provides: yuchberry.sh
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts yuchs
# Description: starts yuchberry server using start-stop-daemon
### END INIT INFO
cd /opt/yuchberry/yuchsbox_server_1.12.1833/
/usr/bin/nohup /usr/bin/java -jar svr.jar &
========
chmod u+x yuchberry.sh
mv runyuchs.sh /etc/init.d/
insserv yuchberry.sh
搞定:-)

--
≋ὥ≋
触手什么的最有爱了~

没有评论:

发表评论