More than 1 year has passed since last update.

https://github.com/matsumoto-r/rcon

Download

cd /usr/local/src
git clone https://github.com/matsumoto-r/rcon.git
cd rcon

Build

yum install libcgroup libcgroup-devel
yum groupinstall 'Development Tools'
yum install pam-devel
# よくわかってないが、CentOS6/LinuxAMIではcgconfigを起動しないと以下のエラーでうまくいかなかった
# collect2: ld returned 1 exit status
service cgconfig start

以下のエラーで失敗するのでcgconfig起動する必要がある

....
/vagrant/shared/rcon/mruby/build/mrbgems/mruby-cgroup/src/mrb_cgroup.c:573: undefined reference to `cgroup_set_value_bool'
/vagrant/shared/rcon/mruby/build/mrbgems/mruby-cgroup/src/mrb_cgroup.c:573: undefined reference to `cgroup_strerror'
/vagrant/shared/rcon/mruby/build/host/lib/libmruby.a(mrb_cgroup.o): In function `mrb_cgroup_get_memory_oom_control':
/vagrant/shared/rcon/mruby/build/mrbgems/mruby-cgroup/src/mrb_cgroup.c:596: undefined reference to `cgroup_get_value_bool'
/vagrant/shared/rcon/mruby/build/mrbgems/mruby-cgroup/src/mrb_cgroup.c:596: undefined reference to `cgroup_strerror'
collect2: ld returned 1 exit status
rake aborted!

以下のエラーで失敗するのでpam-develが必要

configure: error: Cannot compile PAM module without libpam!
rake aborted!
pwd
  # /usr/local/src/rcon/
rake
cp -i mruby/bin/rcon /usr/bin

Check

# 通常実行だとCPU100%になるコマンドなので注意して実行してください
rcon --user root --command "yes >> /dev/null" --cpu 10

Environment

以下3環境でinstallできることを確認

% uname -a
Linux *** 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

% cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
% uname -a
Linux *** 3.14.27-25.47.amzn1.x86_64 #1 SMP Wed Dec 17 18:36:15 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

% cat /etc/issue
Amazon Linux AMI release 2014.09
Kernel \r on an \m
% cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)