Skip to content

Commit

Permalink
fixed: missing log file and directories are not created
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindrem committed Sep 30, 2024
1 parent 9db248a commit e52f42d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
32 changes: 17 additions & 15 deletions HelperResources/EssentialResources
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,6 @@ servicesDir="$scriptDir/services"

# LogHandler functions and variables

logDir="/var/log/PackageManager"
logFile="$logDir/current"
if ! [ "$logDir" ]; then
mkdir -P "$logDir"
touch "$logFile"
fi

oldLogFile="/var/log/SetupHelper"
if [ -e "$oldLogFile" ]; then
if (( $( tail -5 "$oldLogFile" | grep -c "WARNING: this log file no longer used" ) == 0 )); then
echo "WARNING: this log file no longer used" >> "$oldLogFile"
echo " SetupHelper now logged to /var/log/PackageManager/current" >> "$oldLogFile"
fi
fi

# enable logging to console
# scripts can disable logging by setting
# logToConsole to false AFTER sourcing EssentialResources
Expand All @@ -78,6 +63,23 @@ logMessage ()
echo "$shortScriptName: $*" | tai64n >> $logFile
}

# create log file and directory tree if it does not exist yet
logDir="/var/log/PackageManager"
logFile="$logDir/current"
if ! [ -e "$logDir" ]; then
mkdir -p "$logDir"
touch "$logFile"
logMessage "creating log file and directory"
fi

oldLogFile="/var/log/SetupHelper"
if [ -e "$oldLogFile" ]; then
if (( $( tail -5 "$oldLogFile" | grep -c "WARNING: this log file no longer used" ) == 0 )); then
echo "WARNING: this log file no longer used" >> "$oldLogFile"
echo " SetupHelper now logged to /var/log/PackageManager/current" >> "$oldLogFile"
fi
fi


# rc local file that calls reinstallMods
# rcS.local avoids conflicts with mods that blindly replace /data/rc.local
Expand Down
2 changes: 1 addition & 1 deletion blindInstall/SetupHelperVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.21
v8.22
5 changes: 5 additions & 0 deletions changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v8.22:
fixed: missing log file and directories are not created
until the PackageManager service starts
so messages logged before that are not present in the log file

v8.21:
fixed: patch error for some files if package is reinstalled

Expand Down
Binary file modified venus-data-UninstallPackages.tgz
Binary file not shown.
Binary file modified venus-data.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.21
v8.22

0 comments on commit e52f42d

Please sign in to comment.