aboutsummaryrefslogtreecommitdiffstats
path: root/main/backuppc/fix-pidfile-path.patch
blob: ad76a5396129f3ed4278fd651bb0eda1572501ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- a/bin/BackupPC
+++ b/bin/BackupPC
@@ -363,11 +363,11 @@
     # Write out our initial status and save our PID
     #
     StatusWrite();
-    unlink("$LogDir/BackupPC.pid");
-    if ( open(PID, ">", "$LogDir/BackupPC.pid") ) {
+    unlink("/run/backuppc/BackupPC.pid");
+    if ( open(PID, ">", "/run/backuppc/BackupPC.pid") ) {
         print(PID $$);
         close(PID);
-        chmod(0444, "$LogDir/BackupPC.pid");
+        chmod(0444, "/run/backuppc/BackupPC.pid");
     }
 
     #
@@ -1846,7 +1846,7 @@
         close(LOG);
         LogFileOpen();
         print(LOG "Fatal error: unhandled signal $SigName\n");
-        unlink("$LogDir/BackupPC.pid");
+        unlink("/run/backuppc/BackupPC.pid");
         confess("Got new signal $SigName... quitting\n");
     } else {
 	$SigName = shift;
@@ -1968,7 +1968,7 @@
     }
     delete($Info{pid});
     StatusWrite();
-    unlink("$LogDir/BackupPC.pid");
+    unlink("/run/backuppc/BackupPC.pid");
     exit(1);
 }