Skip to content

Commit 87f643c

Browse files
Fixes new process recovery service not being executable & removed duplicate functionality in it for removing leftover lock files
1 parent 6921e26 commit 87f643c

File tree

4 files changed

+3
-45
lines changed

4 files changed

+3
-45
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CONTRIBUTORS
22

33
This file is automatically generated. DO NOT EDIT MANUALLY.
4-
Generated on: 2025-09-23T09:50:10.069578Z
4+
Generated on: 2025-09-23T10:56:33.176668Z
55

66
Upstream project: https://github.com/janeczku/calibre-web
77
Fork project (Calibre-Web Automated, since 2024): https://github.com/crocodilestick/calibre-web-automated

root/etc/s6-overlay/s6-rc.d/cwa-process-recovery/run

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -34,49 +34,6 @@ safe_kill_process() {
3434
fi
3535
}
3636

37-
# Clean up stale lock files and associated processes
38-
cleanup_stale_locks() {
39-
echo "[cwa-process-recovery] Checking for stale lock files and processes..."
40-
41-
local lock_files=(
42-
"/tmp/ingest_processor.lock"
43-
"/tmp/convert_library.lock"
44-
"/tmp/cover_enforcer.lock"
45-
"/tmp/kindle_epub_fixer.lock"
46-
)
47-
48-
local cleaned_count=0
49-
50-
for lock_file in "${lock_files[@]}"; do
51-
if [ -f "$lock_file" ]; then
52-
local lock_name=$(basename "$lock_file" .lock)
53-
echo "[cwa-process-recovery] Found stale lock file: $lock_file"
54-
55-
# Try to read PID from lock file
56-
local pid=""
57-
if [ -r "$lock_file" ]; then
58-
pid=$(cat "$lock_file" 2>/dev/null | head -1 | tr -d '\n' | grep -E '^[0-9]+$' || true)
59-
fi
60-
61-
if [ -n "$pid" ]; then
62-
# Kill the process if it's still running
63-
safe_kill_process "$pid" "$lock_name"
64-
fi
65-
66-
# Remove the lock file
67-
rm -f "$lock_file"
68-
echo "[cwa-process-recovery] Removed stale lock file: $lock_file"
69-
((cleaned_count++))
70-
fi
71-
done
72-
73-
if [ $cleaned_count -eq 0 ]; then
74-
echo "[cwa-process-recovery] No stale lock files found"
75-
else
76-
echo "[cwa-process-recovery] Cleaned up $cleaned_count stale lock file(s)"
77-
fi
78-
}
79-
8037
# Clean up stale temporary processing files
8138
cleanup_temp_files() {
8239
echo "[cwa-process-recovery] Cleaning up stale temporary files..."
@@ -178,7 +135,6 @@ cleanup_orphaned_processes() {
178135
# Main recovery sequence
179136
echo "[cwa-process-recovery] ========== Starting Recovery Sequence =========="
180137

181-
cleanup_stale_locks
182138
cleanup_temp_files
183139
reset_processing_status
184140
cleanup_orphaned_processes
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/s6-overlay/s6-rc.d/cwa-process-recovery/run

scripts/setup-cwa.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ change_script_permissions () {
1515
chmod +x /etc/s6-overlay/s6-rc.d/cwa-auto-zipper/run
1616
chmod +x /etc/s6-overlay/s6-rc.d/cwa-ingest-service/run
1717
chmod +x /etc/s6-overlay/s6-rc.d/cwa-init/run
18+
chmod +x /etc/s6-overlay/s6-rc.d/cwa-process-recovery/run
1819
chmod +x /etc/s6-overlay/s6-rc.d/metadata-change-detector/run
1920
chmod +x /etc/s6-overlay/s6-rc.d/calibre-binaries-setup/run
2021
chmod +x /etc/s6-overlay/s6-rc.d/svc-calibre-web-automated/run

0 commit comments

Comments
 (0)