Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Fan-Control-Daemon
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CeRiAl
Fan-Control-Daemon
Commits
8ed60e90
Commit
8ed60e90
authored
Aug 22, 2012
by
Daniel Graziotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #14 and enhances Readme.md
parent
fcf18f52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
+24
-14
Makefile
Makefile
+4
-0
README.md
README.md
+18
-12
mbpfan.c
src/mbpfan.c
+2
-2
No files found.
Makefile
View file @
8ed60e90
...
@@ -58,6 +58,10 @@ tests:
...
@@ -58,6 +58,10 @@ tests:
make
install
make
install
sudo
/usr/sbin/mbpfan
-f
-v
-t
sudo
/usr/sbin/mbpfan
-f
-v
-t
uninstall
:
rm
/usr/sbin/mbpfan
rm
/etc/mbpfan.conf
install
:
install
:
make
make
cp
$(EXE)
/usr/sbin
cp
$(EXE)
/usr/sbin
...
...
README.md
View file @
8ed60e90
...
@@ -56,32 +56,38 @@ sudo service mbpfan start
...
@@ -56,32 +56,38 @@ sudo service mbpfan start
Starting at boot
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
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)
Rename it to mbpfan, give it execution permissions (chmod +x mbpfan)
and move it to /etc/init.d
and move it to /etc/init.d
Then, add it to the default runlevels with sudo update-rc.d mbpfan defaults
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
(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
mbpfan.init.redhat. Also rename it to mbpfan, give it execution permissions
and move it to /etc/init.d
and move it to /etc/init.d
To add the script to the default runlevels, run the following as root:
To add the script to the default runlevels, run the following as root:
chkconfig --level 2345 mbpfan on && chkconfig --level 016 mbpfan off
chkconfig --level 2345 mbpfan on && chkconfig --level 016 mbpfan off
For upstart based init systems (Ubuntu), an example upstart job has been
**systemd**
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
As a special bonus, a service file for systemd is also included. To use it,
As a special bonus, a service file for systemd is also included. To use it,
execute the following as root:
execute the following as root:
cp mbpfan.service /usr/lib/systemd/system
sudo cp mbpfan.service /usr/lib/systemd/system
ln -s /usr/lib/systemd/system/mbpfan.service /etc/systemd/system/mbpfan.service
sudo ln -s /usr/lib/systemd/system/mbpfan.service /etc/systemd/system/mbpfan.service
systemctl daemon-reload
sudo systemctl daemon-reload
systemctl start mbpfan.service
sudo systemctl start mbpfan.service
To start the service automatically at boot, also execute the following:
To start the service automatically at boot, also execute the following:
systemctl enable mbpfan.service
s
udo s
ystemctl enable mbpfan.service
Usage
Usage
...
...
src/mbpfan.c
View file @
8ed60e90
...
@@ -78,7 +78,7 @@ t_sensors *retrieve_sensors()
...
@@ -78,7 +78,7 @@ t_sensors *retrieve_sensors()
const
char
*
path_end
=
"_input"
;
const
char
*
path_end
=
"_input"
;
int
path_size
=
strlen
(
path_begin
)
+
strlen
(
path_end
)
+
2
;
int
path_size
=
strlen
(
path_begin
)
+
strlen
(
path_end
)
+
2
;
char
number
[
1
];
char
number
[
2
];
sprintf
(
number
,
"%d"
,
0
);
sprintf
(
number
,
"%d"
,
0
);
int
i
=
0
;
int
i
=
0
;
...
@@ -132,7 +132,7 @@ void find_fans(t_sensors* sensors)
...
@@ -132,7 +132,7 @@ void find_fans(t_sensors* sensors)
int
path_min_size
=
strlen
(
path_begin
)
+
strlen
(
path_output_end
)
+
2
;
int
path_min_size
=
strlen
(
path_begin
)
+
strlen
(
path_output_end
)
+
2
;
int
path_man_size
=
strlen
(
path_begin
)
+
strlen
(
path_man_end
)
+
2
;
int
path_man_size
=
strlen
(
path_begin
)
+
strlen
(
path_man_end
)
+
2
;
char
number
[
1
];
char
number
[
2
];
sprintf
(
number
,
"%d"
,
0
);
sprintf
(
number
,
"%d"
,
0
);
int
n_sensors
=
0
;
int
n_sensors
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment