(sort of) fixes #8

This commit is contained in:
Daniel Graziotin 2012-06-15 21:47:23 +02:00
parent 3551dcc3c4
commit a6cc7a45b6
5 changed files with 28 additions and 8 deletions

View file

@ -54,6 +54,13 @@ clean:
install:
cp $(EXE) /usr/sbin
@echo "-----------------------------------------------------------------------------"
@echo "An init file suitable for /lib/lsb/init-functions (Debian & Ubuntu fur sure)"
@echo "Is located in the main folder of the source files. It is called mbpfan.init."
@echo "Rename it to mbpfan, give it execution permissions (chmod +x mbpfan)"
@echo "and move it to /etc/init.d"
@echo "Then, add it to the default runlevels with sudo update-rc.d mbpfan defaults"
@echo "-----------------------------------------------------------------------------"
rebuild: clean all
#rebuild is not entirely correct

View file

@ -29,16 +29,29 @@ Install Instructions
--------------------
Install with
make install
sudo make install
It actually copies mbpfan to /usr/sbin.
An init file suitable for /lib/lsb/init-functions (Debian & Ubuntu fur sure)
Is located in the main folder of the source files. It is called mbpfan.init.
Rename it to mbpfan, give it execution permissions (chmod +x mbpfan)
and move it to /etc/init.d
Then, add it to the default runlevels with sudo update-rc.d mbpfan defaults (Ubuntu example)
It actually copies mbpfan to /usr/sbin,
Run Instructions
---------------------
Run with
If not installed, run with
sudo bin/mbpfan
If installed, manually run with
sudo mbpfan
If installed and using the init file, run with (Ubuntu example)
sudo service mbpfan start
License
---------------------

View file

@ -85,7 +85,7 @@ void signal_handler(int signal)
}
}
void go_daemon(void (*mbpfan)())
void go_daemon(void (*fan_control)())
{
// Setup signal handling before we start
@ -168,7 +168,7 @@ void go_daemon(void (*mbpfan)())
}
mbpfan();
fan_control();
if(daemonize){
syslog(LOG_INFO, "%s daemon exiting", program_name);

View file

@ -62,7 +62,7 @@ int main(int argc, char *argv[])
}
// pointer to mbpfan() function in mbpfan.c
void (*mbpfan)() = mbpfan;
go_daemon(mbpfan);
void (*fan_control)() = mbpfan;
go_daemon(fan_control);
exit(0);
}

View file

@ -52,7 +52,7 @@ int low_temp = 63; // try ranges 55-63
int high_temp = 66; // try ranges 58-66
int max_temp = 86; // do not set it > 90
int polling_interval = 5;
int polling_interval = 7;
struct s_sensors {