Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I'm trying to make systemd start my terraria server in a tmux session on boot.
- I've been trying for 2 days straight now, I really hope someone can help.
- This is what I've tried so far:
- [Unit]
- Description=Terraria
- After=network.target
- [Service]
- Type=forking
- WorkingDirectory=/mnt/usb1/appdata/programmer/terraria
- User=argon
- Group=argon
- ExecStart=/usr/bin/tmux new-session -s terra -d "./TShock.Server -world worlds/God_eftermiddag_.wld"
- ExecStop=/usr/bin/tmux send-keys -t terra-%i:0.0 "exit" C-m
- ExecStop=/bin/sleep 2
- [Install]
- WantedBy=multi-user.target
- When I save the above and do a systemctl daemon-reload and systemctl start terraria nothing happens.
- Running a systemctl status terraria.service gives the following output:
- ● terraria.service - Terraria
- Loaded: loaded (/etc/systemd/system/terraria.service; disabled; vendor preset: enabled)
- Active: failed (Result: exit-code) since Sun 2022-11-27 10:43:05 CET; 3s ago
- Process: 220085 ExecStart=/usr/bin/tmux new-session -s terra -d ./TShock.Server -world worlds/God_eftermiddag_.wld (code=exited, status=0/SUCCESS)
- Process: 220091 ExecStop=/usr/bin/tmux send-keys -t terra-:0.0 exit C-m (code=exited, status=1/FAILURE)
- Main PID: 220087 (code=exited, status=0/SUCCESS)
- CPU: 64ms
- Nov 27 10:43:05 argon systemd[1]: Starting Terraria...
- Nov 27 10:43:05 argon systemd[1]: Started Terraria.
- Nov 27 10:43:05 argon tmux[220091]: no server running on /tmp/tmux-1000/default
- Nov 27 10:43:05 argon systemd[1]: terraria.service: Control process exited, code=exited, status=1/FAILURE
- Nov 27 10:43:05 argon systemd[1]: terraria.service: Failed with result 'exit-code'.
- I used to run a minecraft (java) server with an almost identical systemd file which works.
- So my guess is this is either do to dotnet (since terraria requires dotnet) or bash somehow.
- I can send the working minecraft systemd file if it helps anything.
- I'm running Raspberry Pi OS Bullseye 64-bit on a Raspberry Pi 4B+ 8GB RAM.
- EDIT:
- In case someone should ask, yes - running the following line standing in the working directory works:
- tmux new-session -s terra -d "./TShock.Server -world worlds/God_eftermiddag_.wld"
Advertisement
Add Comment
Please, Sign In to add comment