Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbpfan #3

Open
wants to merge 293 commits into
base: master
Choose a base branch
from
Open

mbpfan #3

wants to merge 293 commits into from

Conversation

moking
Copy link

@moking moking commented Jan 19, 2017

No description provided.

Daniel Graziotin and others added 30 commits November 18, 2012 22:16
The deamon should never stop respawning. Way to important!
Change upstart to respawn forever
This prevents two defunct sub processes hanging around.
pclose the popened processes
Added John Ferlito contribution
Better systemd service file
Also use consistent heading.
gaul and others added 23 commits April 30, 2020 19:27
This should allow iMacs to complete tests successfully.  Fixes #212.
Fixes #215.
Removed instructions for using -t flag
Moved check_requirements function from main to mbpfan
Moved daemonize and verbose globals from main to daemon
Moved strings for program information from main to global.h
Moved strings for coretemp and applesmc paths from main to mbpfan.c
Updated Makefile
Turned on verboseness for testing
Useful for monitoring intel_pstate effects.
Run with:

clang-format -i src/*

Closes #233.
Fixes #213.  References #247.
The run directory has been moved from /var/run to /run in systemd,
which results in the following warning at boot:

```
/usr/lib/systemd/system/mbpfan.service:10: PIDFile= references a path below legacy directory /var/run/, updating /var/run/mbpfan.pid → /run/mbpfan.pid; please update the unit file accordingly.
```

Additionally, the service occasionally fails to start if the service
is started before coretemp devices have finished probing, which results
in the following error. This patch fixes this issue.

```
systemd[1]: Started A fan manager daemon for MacBook Pro.
mbpfan[350]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting.
systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: mbpfan.service: Failed with result 'exit-code'.
systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 1.
systemd[1]: Stopped A fan manager daemon for MacBook Pro.
systemd[1]: Started A fan manager daemon for MacBook Pro.
mbpfan[369]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting.
systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: mbpfan.service: Failed with result 'exit-code'.
systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 2.
systemd[1]: Stopped A fan manager daemon for MacBook Pro.
mbpfan[380]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting.
systemd[1]: Started A fan manager daemon for MacBook Pro.
systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: mbpfan.service: Failed with result 'exit-code'.
systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 3.
mbpfan[393]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting.
systemd[1]: Stopped A fan manager daemon for MacBook Pro.
systemd[1]: Started A fan manager daemon for MacBook Pro.
systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: mbpfan.service: Failed with result 'exit-code'.
systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 4.
systemd[1]: Stopped A fan manager daemon for MacBook Pro.
systemd[1]: Started A fan manager daemon for MacBook Pro.
mbpfan[416]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting.
systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: mbpfan.service: Failed with result 'exit-code'.
systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 5.
systemd[1]: Stopped A fan manager daemon for MacBook Pro.
systemd[1]: mbpfan.service: Start request repeated too quickly.
systemd[1]: mbpfan.service: Failed with result 'exit-code'.
systemd[1]: Failed to start A fan manager daemon for MacBook Pro.
```
to reflect `PIDFile=/run/mbpfan.pid` in the service file
When building with clang-16, the following build error is raised.

clang -c -O2 -march=x86-64 -pipe -pipe -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0  -g  -Wall -Wextra -Wno-unused-function -std=c99 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=500 src/util.c -osrc/util.o
src/util.c:13:9: error: call to undeclared function 'vsyslog'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        vsyslog(level, fmt, args);
        ^
src/util.c:13:9: note: did you mean 'syslog'?
/usr/include/syslog.h:62:6: note: 'syslog' declared here
void syslog (int, const char *, ...);

This is due to vsyslog being available when _GNU_SOURCE or _BSD_SOURCE
is defined [1]. This patch does that, thus fixing the error.

[1]: https://linux.die.net/man/3/vsyslog

Bug: https://bugs.gentoo.org/894522
Signed-off-by: Brahmajit Das <[email protected]>
Found via clang-tidy.
Found via clang-tidy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.