-
Notifications
You must be signed in to change notification settings - Fork 148
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
moking
wants to merge
293
commits into
rvega:master
Choose a base branch
from
linux-on-mac:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
mbpfan #3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
Found via clang-tidy.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.