Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for failed schedule reboot and map rendering conflicts #40

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions pzserver/pzenv
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ PZSERVERSTART="${PZSERVER}/start-server.sh"
PZSERVERSANDBOX="${PZSERVERDIR}/servertest_SandboxVars.lua"
PZSERVERSPAWNPOINTS="${PZSERVERDIR}/servertest_spawnpoints.lua"
PZSERVERSPAWNREGIONS="${PZSERVERDIR}/servertest_spawnregions.lua"
PZSERVERLOCK="${CACHEDIR}/pzserver.${USER}.lock"

JAVAMODSVERSION=0.0.1
JAVAMODSARCHIVE="javamods-${JAVAMODSVERSION}.zip"
Expand Down Expand Up @@ -230,26 +229,10 @@ check_not_running() {
fi
}

search_pz_pid() {

while read PROC; do

grep -l 'ProjectZomboid' "${PROC}/comm" 2> /dev/null | cut -f3 -d/

done < <(find /proc -maxdepth 1 -type d -user "${USER}")
}

get_pz_pid() {

PIDS=$(search_pz_pid)
for PID in ${PIDS[@]}; do

LINK="$(readlink "/proc/${PID}/fd/0")"
if [ "${LINK}" != '/dev/null' ]; then
echo $PID
fi

done
if pgrep ProjectZomboid -u ${USER} > /dev/null 2>&1; then
echo $(pgrep ProjectZomboid -u ${USER})
fi
}

ask_confirmation() {
Expand Down
2 changes: 1 addition & 1 deletion pzserver/pzstart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ check_not_running

check_first_time

detach flock -n "${PZSERVERLOCK}" "$(dirname "${0}")/pzstartloop" ${ADMINUSEROPTION} ${ADMINPASSWDOPTION} ${@} &
detach "$(dirname "${0}")/pzstartloop" ${ADMINUSEROPTION} ${ADMINPASSWDOPTION} ${@} &

sleep 0.5

Expand Down
2 changes: 0 additions & 2 deletions pzserver/pzstartloop
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ while true; do

[[ -f "${PZSERVERLOG}" ]] && cp "${PZSERVERLOG}" "${PZSERVERLOG}.old"

pzlinkmaps

pzwrap "${PZSERVERSTART}" ${@} &> /dev/null

if [ "${?}" != '0' ]; then
Expand Down
1 change: 0 additions & 1 deletion pzserver/pzstatus
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

check_is_pzserver_user

flock -n "${PZSERVERLOCK}" echo > /dev/null
if [ "${?}" = '0' ] && [ -z "$(get_pz_pid)" ]; then
echo Status: Not running

Expand Down