Commit 8ed60e90 authored by Daniel Graziotin's avatar Daniel Graziotin

Fixes #14 and enhances Readme.md

parent fcf18f52
......@@ -58,6 +58,10 @@ tests:
make install
sudo /usr/sbin/mbpfan -f -v -t
uninstall:
rm /usr/sbin/mbpfan
rm /etc/mbpfan.conf
install:
make
cp $(EXE) /usr/sbin
......
......@@ -56,32 +56,38 @@ sudo service mbpfan start
Starting at boot
----------------
An init file suitable for /lib/lsb/init-functions (Debian & Ubuntu for sure)
**Ubuntu**
For upstart based init systems (Ubuntu), an example upstart job has been
provided for use in place of the LSB-style init script.
To use, execute:
sudo cp mbpfan.upstart /etc/init/mbpfan.conf
sudo start mbpfan
**Debian**
An init file suitable for /lib/lsb/init-functions (Debian)
is located in the main folder of the source files, called mbpfan.init.debian
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
Additionally, an init file suitable for /etc/rc.d/init.d/functions
**Redhat, CentOS, Fedora**
An init file suitable for /etc/rc.d/init.d/functions
(RHEL/CentOS & Fedora) is also located at the same place, this file is called
mbpfan.init.redhat. Also rename it to mbpfan, give it execution permissions
and move it to /etc/init.d
To add the script to the default runlevels, run the following as root:
chkconfig --level 2345 mbpfan on && chkconfig --level 016 mbpfan off
For upstart based init systems (Ubuntu), an example upstart job has been
provided for use in place of the LSB-style init script. To use, execute
as root:
cp mbpfan.upstart /etc/init/mbpfan.conf
start mbpfan
**systemd**
As a special bonus, a service file for systemd is also included. To use it,
execute the following as root:
cp mbpfan.service /usr/lib/systemd/system
ln -s /usr/lib/systemd/system/mbpfan.service /etc/systemd/system/mbpfan.service
systemctl daemon-reload
systemctl start mbpfan.service
sudo cp mbpfan.service /usr/lib/systemd/system
sudo ln -s /usr/lib/systemd/system/mbpfan.service /etc/systemd/system/mbpfan.service
sudo systemctl daemon-reload
sudo systemctl start mbpfan.service
To start the service automatically at boot, also execute the following:
systemctl enable mbpfan.service
sudo systemctl enable mbpfan.service
Usage
......
......@@ -78,7 +78,7 @@ t_sensors *retrieve_sensors()
const char *path_end = "_input";
int path_size = strlen(path_begin) + strlen(path_end) + 2;
char number[1];
char number[2];
sprintf(number,"%d",0);
int i = 0;
......@@ -132,7 +132,7 @@ void find_fans(t_sensors* sensors)
int path_min_size = strlen(path_begin) + strlen(path_output_end) + 2;
int path_man_size = strlen(path_begin) + strlen(path_man_end) + 2;
char number[1];
char number[2];
sprintf(number,"%d",0);
int n_sensors = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment