quarantin / pz-server-tools Goto Github PK
View Code? Open in Web Editor NEWA set of tools to help you with running a Project Zomboid game server (Linux only)
License: GNU Affero General Public License v3.0
A set of tools to help you with running a Project Zomboid game server (Linux only)
License: GNU Affero General Public License v3.0
I have increased the maxmem from default 8g to 13g but every restart of the server, it simply reset back to default again.
According to the official, the json shouldn't reset to default unless the server update or check for new version
As topic
it seams that the aplication left some files in the system after uninstalling
not sure which files to be deleted
This is a clean install on a fresh ubuntu vps and yes, there are some errors.
I noticed that the cron for pzserver1 is not installed so I took the luxury to input manually myself but when during daily restart, this error pop up and then removed the crons job that I have added.
OK
cp: cannot stat '/home/pzstadmin/pz-server-tools/cron/pzserver': Permission denied
cat: '/home/pzserver1/.pzst/crontabs/*': No such file or directory
find: The argument to -user should not be empty
OK
Evidently, it cannot access pzstadmin's home dir which make sense because the permission is "pzstadmin:pzstadmin" w/ 750 and not "pzstadmin:pzst"
I've copied and pasted a friends config and made sure that Mods= was empty, as that's not in the manual.
I've kept the WorkshopItems= line as per his config and fired up the server. He has a line of "Mods: Ravencreekd, Authentic-z-Current and 35 more.." but my server didn't show that. I was also missing options like Extra Traits mod i put in the WorkshopItems= line.
After i copied his Mods= line everything started to work for me.
To clarify:
I used
pzserver config
To add the ID's to WorkshopItems=
After that, ran
pzserver checkmods
and it saw a few mods (i don't think all of them for some reason?)
Only after using the line Mods= with the names in them, they seemed to start working
Sometimes when the server restart, it will boot up with two instances, I am not sure why.
After moving servers and reinstalling pz-server-tool on the new one, we noticed that other jobs we add to the pzserver1 crontab AND ProjectZomboid64.json are being reset frequently to factory settings. (EDIT Jul 5: it happens on the planned restarts defined at /etc/pzst/config.json).
This is causing Xmx to reset to 8 GB (we have 128 GB, I'm using 96 GB) and server ends up crashing after a restart.
I checked crontab, it seems to be there
* * * * * pzupdate
I checked the /etc/pzst/config.json on both pzstadmin and pzserver1 too
Also used pzst checkconfig command.
{ "daily-restarts": [ "03:00", "09:00", "15:00", "21:00" ], "editor": "nano", "max-backups": 5, "pzservers": [ "pzserver1" ], "restart-sequence": [ 10, 5, 2, 1 ], "user": "pzstadmin", "install": "/home/pzstadmin/pz-server-tools" }
What am I missing?
Some kind of permissions?
I'm not sure if this is an issue but I wanted to edit the restart sequence text to "10 minutes" instead of the original "10:00 minutes" as some players got confused about it.
The only file I found about this is in pz-server-tools/pzserver/pzrestartjob.
Apparently this file does nothing (maybe a source code).
Question: is there a way to edit the warning text?
I just installed pzst tools on a new server. Everything is working except the auto restart schedule in the config.json isn't taking effect. I'm been having to manually restart the server.
pzserver1@mix74p3:~$ pzserver checkmods
Traceback (most recent call last):
File "/usr/local/bin/pzcheckmods", line 125, in
PZModMonitor(config, restart=restart, update_cache=update_cache)
File "/usr/local/bin/pzcheckmods", line 28, in init
new_cache = self.get_new_cache(mods)
File "/usr/local/bin/pzcheckmods", line 65, in get_new_cache
return get_mod_updates(mods)
File "/etc/pzst/env/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/etc/pzst/env/lib/python3.8/site-packages/retry/api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "/etc/pzst/env/lib/python3.8/site-packages/retry/api.py", line 33, in __retry_internal
return f()
File "/etc/pzst/env/lib/python3.8/site-packages/pypzst/init.py", line 60, in get_mod_updates
for workshop_item in jsondata['response']['publishedfiledetails']:
KeyError: 'response'
On pzbackupsave, line 26:
tar cf - "${PZSERVERSAVE}" | lz4 > "${ZOMBOID}/Saves.$(date +%Y%m%d-%H%M%S)${UNSAFEBACKUP}.tar.lz4"
The line above will miss following symlinks if, for example, Saves is in a ramdisk.
Is that ok to replace it with the following which adds 'h' to tar options? It seems to address the problem.
tar chf - "${PZSERVERSAVE}" | lz4 > "${ZOMBOID}/Saves.$(date +%Y%m%d-%H%M%S)${UNSAFEBACKUP}.tar.lz4"
How feasible would it be to convert the pz-server-tools to a Pterodactyl Egg that replaces the current egg?
https://github.com/parkervcp/eggs/tree/master/game_eggs/steamcmd_servers/project_zomboid
When pzst detect a workshop mod update and waiting for restart, if another mod update comes in, then it never restart after quit.
Hello i have problem when i run this
pzserver install
Redirecting stderr to '/home/pzserver/Steam/logs/stderr.txt'
Logging directory: '/home/pzserver/Steam/logs'
[ 0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation - version 1702079268
-- type 'quit' to exit --
Loading Steam API...dlmopen steamservice.so failed: steamservice.so: cannot open shared object file: No such file or directory
OK
Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
Update state (0x5) verifying install, progress: 5.37 (284945507 / 5303283844)
Update state (0x5) verifying install, progress: 15.51 (822687599 / 5303283844)
Update state (0x5) verifying install, progress: 29.75 (1577634859 / 5303283844)
Update state (0x5) verifying install, progress: 40.59 (2152735235 / 5303283844)
Update state (0x5) verifying install, progress: 51.58 (2735358915 / 5303283844)
Update state (0x5) verifying install, progress: 62.38 (3308450803 / 5303283844)
Update state (0x5) verifying install, progress: 71.22 (3776807203 / 5303283844)
Update state (0x5) verifying install, progress: 80.88 (4289355100 / 5303283844)
Update state (0x5) verifying install, progress: 93.32 (4949226864 / 5303283844)
Update state (0x61) downloading, progress: 0.00 (0 / 3053)
Success! App '380870' fully installed.
cp: cannot create regular file '/etc/pzst/config.json': Permission denied
OK
Hey, sorry to bother you again but I posted a bug under my former issue topic and I'm not sure you are able to see it as you closed it.
So the bug is:
"LOG : General , 1683314201099> 1,395,088,542> command entered via server console (System.in): "servermsg "Restarting server in 1 minutes""
LOG : General , 1683314201121> 1,395,088,563> Message sent.
LOG : General , 1683314501434> 1,395,388,877> command entered via server console (System.in): "servermsg "Restarting server in 5 minutes. Find a safe place to hide for restart!""
LOG : General , 1683314501503> 1,395,388,946> Message sent.
LOG : General , 1683314681642> 1,395,569,085> command entered via server console (System.in): "servermsg "Restarting server in 2 minutes. Find a safe place to hide for restart!""
LOG : General , 1683314681706> 1,395,569,148> Message sent.
LOG : General , 1683314741710> 1,395,629,153> command entered via server console (System.in): "servermsg "Restarting server in 1 minute. Find a safe place to hide for restart!""
LOG : General , 1683314741806> 1,395,629,248> Message sent."
There is a zero missing from the first warning.
Additional question: can you make me specific mods, ideas for a PZ mutiplayer server (not for free of course)?
Thanks for your work!
I've changed the Sandbox. when restarting the server file servertest_SandboxVars.lua Remember the default. how to fix
Firstly,
The cron jobs for pzst isn't installed, I believe because pzst isn't a user. In any case, I manually added those cron jobs.
This line is returning an error, not allowing to run as root so what am I suppose to run it as?
*/10 * * * * root /usr/local/bin/pzstclearbackups
pzstartloop seems to be hanging on the daily restart and mod updates.
It's a fresh install from a few days ago. Until June 12th it was working flawlessly (I've been using pz-server-tools since March) but with the last commits it seems unstable.
When it's a daily restart or mod update, I see the server shuts down correctly but it doesn't come up. Is there any way I can help looking into it?
We're using Ubuntu 20.04.
think the title said enough
I have a lot of unsafe backups created while the server not starting, why?
Sometimes when I do "pzserver restart", the server shuts down but then it doesn't boot up because it says "Server is running" when it isn't. I had to reboot the vps to get working again.
Hey! I was trying for the first time your project and some commands were not working for me, for example:
pzserver@h3010054:~$ pzserver stop
ERROR: ioctl failed: Operation not permitted
pzserver@h3010054:~$ pzserver message
Usage: /usr/local/bin/pzmessage message...
pzserver@h3010054:~$ pzserver message Test
ERROR: ioctl failed: Operation not permitted
pzserver@h3010054:~$ pzserver command test
ERROR: ioctl failed: Operation not permitted
pzserver@h3010054:~$ pzserver command save
ERROR: ioctl failed: Operation not permitted
pzserver@h3010054:~$ pzserver quit
ERROR: ioctl failed: Operation not permitted
pzserver restart is also not working as well, just give me back an "OK" but no restart.
This is the log:
2023-06-01 18:14:52 PZRestarterJob pzserver: Restart job started (delay: 0, restart_sequence: [5, 2, 1])
2023-06-01 18:14:52 PZRestarterJob pzserver: Sending message: Restarting server in 5 minutes. Find a safe place to hide for restart!
2023-06-01 18:17:52 PZRestarterJob pzserver: Sending message: Restarting server in 2 minutes. Find a safe place to hide for restart!
2023-06-01 18:18:52 PZRestarterJob pzserver: Sending message: Restarting server in 1 minute. Find a safe place to hide for restart!
2023-06-01 18:19:52 PZRestarterJob pzserver: Restarting now!
I was online, but there were no messages nor restart
This is my distro:
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
Do I need to do something else or missed something maybe?
Update:
using RCON directly I can save/close the server (I'm not sure if you are using the same way with thhe scripts)
Waiting commands for 127.0.0.1:27015 (or type :q to exit)
> save
World saved
> save
World saved
> save
World saved
> quit
Quit
So my MP server has this unsafe backup and ever since, all other restart is unsafe.......
How do you fix thix?
When installing on a Ubuntu server (#31~20.04.1-Ubuntu SMP Fri Jan 14 14:37:50 UTC 2022)
ubuntu@zomboid:~$ sudo useradd --create-home --shell /bin/bash pzstadmin
ubuntu@zomboid:~$ sudo passwd pzstadmin
New password:
Retype new password:
passwd: password updated successfully
ubuntu@zomboid:~$ sudo usermod -aG sudo pzstadmin
The ./pzst/pzst install
command outputs a permission denied error after new shell.
ubuntu@zomboid:~$ sudo -i -u pzstadmin
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
pzstadmin@zomboid:~$ git clone https://github.com/quarantin/pz-server-tools
Cloning into 'pz-server-tools'...
remote: Enumerating objects: 1768, done.
remote: Counting objects: 100% (830/830), done.
remote: Compressing objects: 100% (436/436), done.
remote: Total 1768 (delta 562), reused 596 (delta 362), pack-reused 938
Receiving objects: 100% (1768/1768), 224.06 KiB | 8.96 MiB/s, done.
Resolving deltas: 100% (1133/1133), done.
pzstadmin@zomboid:~$ cd pz-server-tools
pzstadmin@zomboid:~/pz-server-tools$ ./pzst/pzst install
[sudo] password for pzstadmin:
[*] Updating package cache
[*] Upgrading packages
Extracting templates from packages: 100%
[*] Installing new package `jq`
[*] Installing new package `python3-venv`
[*] Installing new package `sqlite3`
[*] Installing new package `unzip`
[*] Adding system user: pzst
[*] Creating virtual environment
[*] Installing Project Zomboid Server Tools
mkdir: cannot create directory ‘/home/pzst’: Permission denied
/usr/local/bin/pzst_config: line 19: /home/pzst/.pzst/config.json: No such file or directory
pzstadmin@zomboid:~/pz-server-tools$
With or without it, the map still gonna load and custom spawn points for it still works/
Does this have a tool for clearing the server completely? I'm trying to get everything set back to day 1.
Wanted to try from scratch for attempt xyz to get things to run the way i'd like to :-)
So i did a
pzserver uninstall
While the server was still running, this worked without issues. Though, i could still connect to my server afterwards.
this file gets so big so fast. it locks up my machine. i have to delete the file every day to be able run my server or anything else on my machine. is there anyway i can stop this from happening?
I've just used this incredible tool to install a PZ server. It feels great and really easy to use. But beside the other issue i just posted about the mods, the spawnpoints and spawnregions command is not working on a default install? I'm completely new to project zomboid servers so, forgive me if i saw anything weird:
pzserveroc@c-vps-01:~$ pzserver spawnregions
Configuration not found
pzserveroc@c-vps-01:~$ pzserver spawnpoints
Configuration not found
In this new vps, using kernel "Linux 5.15.35-1-pve"
"pzserver quit" command doesn't work
Is it possible to keep server running despite losing connection to steam? AFAIK, other servers just keep running despite it.
I'm not sure if this is an issue or just a question, but when a mod change is detected and server stops (after the normal countdown) it's taking way longer (maybe close to 10 minutes) than usual for the server to start again. What is the best way to configure restart_delay to, let's say, 1 minute? Thanks!
Whenever stop command is manually entered, the server will stop but it will also boot itself again.
Can you make it completely stop and not boot itself?
i have mods that are unlisted and apparently checkmod is unable to get the details of the unlisted mods
is it possible to fix that or do i hve to make those mods public?
Instead of using this tool to set up a new server I decided to migrate an existing one for better management which I think causes issues with the db even after changing the names of each file (which is also kind of annoying).
After setting everything up and joining the server I was prompted to spawn somewhere new and create a new character which leads me to believe it created a new entry in the db called servertest.
As for fixing this, I feel like it should either be what you name the user that hosts the server, or in the config file something like this:
{
"pzservers": [
{
"pzserver1": "servertest"
}
]
}
Or maybe even just as an argument to pzserver start
Hi, first of all, thank you greatly for your valuable work! your app is wonderful and solves most needs I had with my server. I'm kinda new to linux and coding, and I ran into a problem that I got me stuck.
I'm running your app to run my server on a gcloud VM with ubuntu 20.04 LTS
I installed the game server following the instructions from pzserver github page.
I set an automatic reset for this morning, but when I woke up the server was down, and no proccess was running on the VM.
I tried to use pzserver start, but it returns that pzserver is already running. When I try restart/stop/quit/kill it says there's none running. I unistalled and installed again, but the problem persists. I ran the debug code you posted previously, and it generated a troubleshooting file that I don't know how to interpret. Do you have any idea what can be happening to my server? :/ please help :(
troubleshoot_20231024_125133.log
Hello,
Are you planning to do any updates or the project is abandoned ?????
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.