見出し画像

VPSのRustテンプレートによるOxide環境の構築方法(自動アップデート)

共通の下準備

サーバーのコンソールを立ち上げて下記のコマンドを入力して実行してください。

 sudo apt install unzip

このコマンドは、Oxideの最新ファイルをDLしたときに解凍できるようにするアプリケーションをインストールするコマンドです。

sudo systemctl stop rust-server

このコマンドは、Rustサーバー自体を停止するためのコマンドです。
実行した後は FTPソフト でサーバーに接続してください。

Oxide環境構築(ConohaVPS)

FTPソフトでサーバーに接続しましたら「/etc/systemd/system/rust-server.service」を編集します。

ExecStartPre=/usr/games/steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /opt/rust_server +login anonymous +app_update 258550 validate +quit

の箇所を

ExecStartPre=/usr/games/steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /opt/rust_server +login anonymous +app_update 258550 validate +quit
ExecStartPre=wget https://umod.org/games/rust/download/develop -O oxide.zip
ExecStartPre=unzip -o oxide.zip
ExecStartPre=+/usr/bin/chown -R rust:rust /opt/rust_server/

に変更して保存します。
この変更でRustサーバーの再起動時にRustサーバー自体のアップデートとOxideの最新バージョンのDL・解凍・適用が自動で行われます。
下記のコマンドをサーバーのコンソールで打ち込んで変更した箇所を適用させましょう。

systemctl daemon-reload
systemctl start rust-server

以上でConohaVPSにおけるOxideの環境構築作業は終了です。

Oxide環境構築(XServerVPS)

FTPソフトでサーバーに接続しましたら「/etc/systemd/system/rust-server.service」を編集します。

ExecStartPre=/usr/games/steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /home/steam/rust_server +login anonymous +app_update 258550 validate +quit

の箇所を

ExecStartPre=/usr/games/steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /home/steam/rust_server +login anonymous +app_update 258550 validate +quit
ExecStartPre=wget https://umod.org/games/rust/download/develop -O oxide.zip
ExecStartPre=unzip -o oxide.zip
ExecStartPre=+/usr/bin/chown -R steam:steam /home/steam/rust_server/

に変更して保存します。
この変更でRustサーバーの再起動時にRustサーバー自体のアップデートとOxideの最新バージョンのDL・解凍・適用が自動で行われます。
下記のコマンドをサーバーのコンソールで打ち込んで変更した箇所を適用させましょう。

systemctl daemon-reload
systemctl start rust-server

以上で XServerVPS におけるOxideの環境構築作業は終了です。

サーバーをアップデートするときは?

上記のサイトでRustサーバーにRCON接続をし、「RCONコンソール」を立ち上げて次のコマンドを実行します。

save

上記のコマンドは、Rustサーバーの状態を保存するコマンドです。
実行した後は、同じサイトの「SSHコンソール」でサーバーのコンソールに接続して下記のコマンドを実行します。

systemctl restart rust-server

これでRustサーバーのアップデートが自動で行われます。
RustManagerは、私が作って運営しているRustサーバー管理ツールです。


この記事が気に入ったらサポートをしてみませんか?