Skip to content

Instantly share code, notes, and snippets.

@hashy0917
Created May 19, 2023 03:20
Show Gist options
  • Save hashy0917/f7832245c70ec9e040345dd3c4935412 to your computer and use it in GitHub Desktop.
Save hashy0917/f7832245c70ec9e040345dd3c4935412 to your computer and use it in GitHub Desktop.
マイクラのbedrockサーバーが停止しても自動的に再起動したりするようにするやつ
[Unit]
Description=Minecraft Bedrock Version Server
[Service]
ExecStart=start-minecraft.sh
Restart=always
User=hashy
Type=forking
[Install]
WantedBy=default.target
#!/bin/bash
cd /home/hashy/bedrockED
tmux new-session -d "LD_LIBRARY_PATH=. ./bedrock_server"
@hashy0917
Copy link
Author

やった事

  1. tmuxセッションを開きマイクラサーバーを実行するスクリプトを作成
  2. そのスクリプトを/usr/binに設置
  3. systemdで実行管理する設定ファイルを作成

@hashy0917
Copy link
Author

Discordに稼働状況通知したりしたければstart-minecraft.shの中に仕込めばOK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment