🍣
【Ubuntu】Satisfactory Serverを立てる
UbuntuでSatisfactory鯖を建てる
工場マイクラで知られるSatisfactoryのサーバー環境を建てて遊ぶことにする。2023年4月現在はアーリーアクセス版で製品を開発中。工場の規模が小さいうちはPC負荷は小さいのだが、大規模になるに連れて負荷が大きくなると話題になっている。なのでサーバーを建てて演算処理負荷をサーバー側に投げることにする。ゲームのサーバー版はUnix版/Windows版両方公開されているが、個人的にWindowsは嫌いなためLinuxで構築する。
# パッケージリストのアップデート
sudo apt-get update
# steamcmd インストール
sudo dpkg --add-architecture i386
sudo apt-get install steamcmd
The following additional packages will be installed:
gcc-12-base:i386 krb5-locales libc6:i386 libcom-err2:i386 libcrypt1:i386 libgcc-s1:i386 libgssapi-krb5-2:i386 libidn2-0:i386 libk5crypto3:i386
libkeyutils1:i386 libkrb5-3:i386 libkrb5support0:i386 libnsl2:i386 libnss-nis:i386 libnss-nisplus:i386 libssl3:i386 libstdc++6:i386
libtirpc3:i386 libunistring2:i386
Suggested packages:
glibc-doc:i386 locales:i386 krb5-doc:i386 krb5-user:i386 steam:i386
The following NEW packages will be installed:
gcc-12-base:i386 krb5-locales libc6:i386 libcom-err2:i386 libcrypt1:i386 libgcc-s1:i386 libgssapi-krb5-2:i386 libidn2-0:i386 libk5crypto3:i386
libkeyutils1:i386 libkrb5-3:i386 libkrb5support0:i386 libnsl2:i386 libnss-nis:i386 libnss-nisplus:i386 libssl3:i386 libstdc++6:i386
libtirpc3:i386 libunistring2:i386 steamcmd:i386
0 upgraded, 20 newly installed, 0 to remove and 72 not upgraded.
Need to get 8,793 kB of archives.
After this operation, 31.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
# Satisfactory Server版インストール
ln -s /usr/games/steamcmd steamcmd
./steamcmd +force_install_dir ~/satisfactory +login anonymous +app_update 1690800 validate +quit
# サービスとして登録
[Unit]
Description=Satisfactory dedicated server
Wants=network-online.target
After=syslog.target network.target nss-lookup.target network-online.target
[Service]
Environment="LD_LIBRARY_PATH=./linux64"
ExecStartPre=/usr/games/steamcmd +force_install_dir "/home/your_user/SatisfactoryDedicatedServer" +login anonymous +app_update 1690800 validate +quit
ExecStart=/home/your_user/SatisfactoryDedicatedServer/FactoryServer.sh
User=your_user
Group=your_user
StandardOutput=journal
Restart=on-failure
WorkingDirectory=/home/your_user
[Install]
WantedBy=multi-user.target
# サービス起動
systemctl start satisfactory.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'satisfactory.service'.
Authenticating as: wataru miyakawa (wataru)
Password:
==== AUTHENTICATION COMPLETE ===
Warning: The unit file, source configuration file or drop-ins of satisfactory.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Job for satisfactory.service failed because the control process exited with error code.
See "systemctl status satisfactory.service" and "journalctl -xeu satisfactory.service" for details.
wataru@satisfactory:~/satisfactory$ systemctl daemon-reload
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
Authentication is required to reload the systemd state.
Authenticating as: wataru miyakawa (wataru)
Password:
==== AUTHENTICATION COMPLETE ===
# ステータス確認
systemctl status satisfactory.service
● satisfactory.service - Satisfactory dedicated server
Loaded: loaded (/etc/systemd/system/satisfactory.service; enabled; vendor preset: enabled)
Active: activating (start-pre) since Sat 2023-04-01 02:16:10 UTC; 10s ago
Cntrl PID: 2045 (bash)
Tasks: 20 (limit: 9401)
Memory: 199.0M
CPU: 21.791s
CGroup: /system.slice/satisfactory.service
tq2045 bash /home/wataru/.local/share/Steam/steamcmd/steamcmd.sh +force_install_dir /home/wataru/SatisfactoryDedicatedServer +>
mq2049 /home/wataru/.local/share/Steam/steamcmd/linux32/steamcmd +force_install_dir /home/wataru/SatisfactoryDedicatedServer +>
Apr 01 02:16:10 satisfactory systemd[1]: Starting Satisfactory dedicated server...
Apr 01 02:16:11 satisfactory steamcmd[2049]: Redirecting stderr to '/home/wataru/Steam/logs/stderr.txt'
Apr 01 02:16:11 satisfactory steamcmd[2049]: Looks like steam didn't shutdown cleanly, scheduling immediate update check
Apr 01 02:16:11 satisfactory steamcmd[2049]: [ 0%] Checking for available updates...
Apr 01 02:16:11 satisfactory steamcmd[2049]: [----] Verifying installation...
Apr 01 02:16:11 satisfactory steamcmd[2049]: Steam Console Client (c) Valve Corporation - version 1679680174
Apr 01 02:16:11 satisfactory steamcmd[2049]: -- type 'quit' to exit --
Apr 01 02:16:11 satisfactory steamcmd[2049]: Loading Steam API...OK
Apr 01 02:16:13 satisfactory steamcmd[2049]: Connecting anonymously to Steam Public...OK
Apr 01 02:16:13 satisfactory steamcmd[2049]: Waiting for client config...OK
systemctl status satisfactory.service
# イネーブル化
sudo systemctl enable satisfactory.service
Created symlink /etc/systemd/system/multi-user.target.wants/satisfactory.service → /etc/systemd/system/satisfactory.service.
Discussion