Use /run instead of /var/run for FTL runtime files
Compare with: https://github.com/pi-hole/pi-hole/pull/3248#issuecomment-620752054 Signed-off-by: MichaIng <micha@dietpi.com>
This commit is contained in:
parent
6c240d3888
commit
0fd1e341da
|
@ -10,7 +10,7 @@
|
|||
|
||||
function GetFTLData {
|
||||
# Open connection to FTL
|
||||
exec 3<>/dev/tcp/localhost/"$(cat /var/run/pihole-FTL.port)"
|
||||
exec 3<>/dev/tcp/localhost/"$(cat /run/pihole-FTL.port)"
|
||||
|
||||
# Test if connection is open
|
||||
if { true >&3; } 2> /dev/null; then
|
||||
|
|
|
@ -302,13 +302,13 @@ void read_FTLconf(void)
|
|||
logg(" DBIMPORT: Not importing history from database");
|
||||
|
||||
// PIDFILE
|
||||
getpath(fp, "PIDFILE", "/var/run/pihole-FTL.pid", &FTLfiles.pid);
|
||||
getpath(fp, "PIDFILE", "/run/pihole-FTL.pid", &FTLfiles.pid);
|
||||
|
||||
// PORTFILE
|
||||
getpath(fp, "PORTFILE", "/var/run/pihole-FTL.port", &FTLfiles.port);
|
||||
getpath(fp, "PORTFILE", "/run/pihole-FTL.port", &FTLfiles.port);
|
||||
|
||||
// SOCKETFILE
|
||||
getpath(fp, "SOCKETFILE", "/var/run/pihole/FTL.sock", &FTLfiles.socketfile);
|
||||
getpath(fp, "SOCKETFILE", "/run/pihole/FTL.sock", &FTLfiles.socketfile);
|
||||
|
||||
// SETUPVARSFILE
|
||||
getpath(fp, "SETUPVARSFILE", "/etc/pihole/setupVars.conf", &FTLfiles.setupVars);
|
||||
|
|
|
@ -15,9 +15,9 @@ fi
|
|||
rm -f /etc/pihole/gravity.db /etc/pihole/pihole-FTL.db /var/log/pihole.log /var/log/pihole-FTL.log
|
||||
|
||||
# Create necessary directories and files
|
||||
mkdir -p /etc/pihole /var/run/pihole /var/log
|
||||
touch /var/log/pihole-FTL.log /var/log/pihole.log /var/run/pihole-FTL.pid /var/run/pihole-FTL.port
|
||||
chown pihole:pihole /etc/pihole /var/run/pihole /var/log/pihole.log /var/log/pihole-FTL.log /var/run/pihole-FTL.pid /var/run/pihole-FTL.port
|
||||
mkdir -p /etc/pihole /run/pihole /var/log
|
||||
touch /var/log/pihole-FTL.log /var/log/pihole.log /run/pihole-FTL.pid /run/pihole-FTL.port
|
||||
chown pihole:pihole /etc/pihole /run/pihole /var/log/pihole.log /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port
|
||||
|
||||
# Copy binary into a location the new user pihole can access
|
||||
cp ./pihole-FTL /home/pihole
|
||||
|
|
|
@ -40,7 +40,7 @@ int main (int argc, char **argv) {
|
|||
address.sun_family = AF_LOCAL;
|
||||
|
||||
char *command = ">stats";
|
||||
strcpy(address.sun_path,"/var/run/pihole/FTL.sock");
|
||||
strcpy(address.sun_path,"/run/pihole/FTL.sock");
|
||||
|
||||
int i;
|
||||
for(i = 1; i < argc; i++) {
|
||||
|
|
Loading…
Reference in New Issue