Comments (9)
My logs are free from any errors related to ~/.Xauthority
. I don't use lightdm, so I suspect lightdm may require Xorg to run with ~/.Xauthority
.
ps aux | grep -i xorg
returns /usr/lib/Xorg :0 vt2
for me.
I use ly , it probably just runs xinit
, which in turn runs /usr/lib/Xorg :0 vt2
, which is quite different from the way Xorg was started on your machine.
from nfancurve.
move the .service file to /usr/lib/systemd/system/
instead of /usr/lib/systemd/user/
, run systemctl daemon-reload
for good meassures, and then load/enable the service with systemctl enable --now nfancurve.service
. When you specify --user
you run a service file from /usr/lib/systemd/user
which has insufficient permission, as it runs it as your current user.
from nfancurve.
I tried figuring this out yesterday, I think there was another issue opened here which could run it if they ran xorg as root, however it's a pretty ugly workaround. What ended up working for me was adding export DISPLAY=":0"
at the top of the shell script, a line after the shebang. I ended up scrapping the old .service file and created another one you run at root:
[Unit]
Description=Nfancurve service
After=multi-user.target
[Service]
ExecStart=/usr/bin/nfancurve -c /etc/nfancurve.conf
KillSignal=SIGINT
[Install]
WantedBy=default.target
The biggest issue with this script is that if you enable the script to run at boot, it will fail. Your graphical environment has to be running before the service will work. There are different options to make this work, depending on what setup you have, here are two options: https://unix.stackexchange.com/questions/397853/how-to-set-a-systemd-unit-to-start-after-loading-the-desktop
I'm using i3, but if you're using a DE you might be able to start it with xsession. My solution is really hacky and would be nice if someone else had a cleaner fix.
**also forgot to add, im using the AUR package, thats why it's called nfancurve instead of temp.sh
from nfancurve.
AERDU, thank you very much for your answer!
I tried your solution and it works just perfect for service autostarting. But I still have in my log:
Oct 20 12:23:02 v01k-desktop systemd[661]: Started Nfancurve service.
Oct 20 12:23:02 v01k-desktop nfancurve[668]: Number of Fans detected:
Oct 20 12:23:02 v01k-desktop nfancurve[668]: 1
Oct 20 12:23:02 v01k-desktop nfancurve[668]: Number of GPUs detected:
Oct 20 12:23:02 v01k-desktop nfancurve[668]: 1
Oct 20 12:23:02 v01k-desktop nfancurve[722]: ERROR: The current user does not have permission for operation
Oct 20 12:23:02 v01k-desktop nfancurve[722]: Attribute 'GPUFanControlState' (v01k-desktop:0[gpu:0]) assigned value 1.
Oct 20 12:23:02 v01k-desktop nfancurve[668]: Started process for 1 GPU and 1 Fan
Oct 20 12:23:02 v01k-desktop nfancurve[724]: ERROR: The current user does not have permission for operation
Oct 20 12:23:02 v01k-desktop nfancurve[724]: Attribute 'GPUTargetFanSpeed' (v01k-desktop:0[fan:0]) assigned value 35.
As I said, the fan speed level changes well even with this error.
I'm sorry, but I don't understand a little bit this moment that you wrote: "...and created another one you run at root". I'm not very experienced with Linux services and don't understand how to run service with --user as root. Please clarify this moment for me. Thank you!
P.S. I'm also using i3 and the package from AUR.
from nfancurve.
Oh, thank you! I thought about it, but wasn't sure it is the right way :) And what do you think about why this error appeared after the last Arch update? Could it be related to the latest Nvidia driver?
from nfancurve.
There's another nvidia fan controller at https://github.com/foucault/nvfancontrol that states:
"As of version 465 NVIDIA decided that is a security risk for non-root users to have access to cooler control and overclocking capabilities. So you will have to start X11 as root despite almost no distributions and desktop environment doing so for the past years because it is a massive... security risk. Trading one security risk for another!"
keep in mind that my solution does NOT start X11 as root (at least it shouldn't unless setting $DISPLAY to :0 in a root session somehow elevates xorg). I'm also not sure why you got it after a recent update, v465 was awhile ago unless you use DKMS or something.
from nfancurve.
AERDU, thank you very much for clarifying this problem for me. Yes, it is very strange that I got this error after a recent update, because I always update my system, maybe weekly or even more often. But now everything works fine, and then we'll see, maybe the developer will make some changes. Thanks again!
from nfancurve.
Tiny improvement I made recently, instead of setting the service on a timer I just set it to restart if it exits with an error code:
[Unit]
Description=Nfancurve service
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/nfancurve -c /etc/nfancurve.conf
Restart=on-failure
RestartSec=60s
[Install]
WantedBy=default.target
This should fix the issue instantly, and don't forget to systemctl daemon-reload
.
from nfancurve.
Tiny improvement I made recently, instead of setting the service on a timer I just set it to restart if it exits with an error code:
[Unit] Description=Nfancurve service After=multi-user.target [Service] Type=simple ExecStart=/usr/bin/nfancurve -c /etc/nfancurve.conf Restart=on-failure RestartSec=60s [Install] WantedBy=default.target
This should fix the issue instantly, and don't forget to
systemctl daemon-reload
.
Hello, thanks for your help here. I had the same issue too.
I followed what you wrote :
- move the .service file to
/usr/lib/systemd/system/
instead of/usr/lib/systemd/user/
export DISPLAY=":0"
in the shell script.
But i still had the following errors in journalctl
dec. 07 18:33:27 smith sh[49114]: Authorization required, but no authorization protocol specified
dec. 07 18:33:20 smith sh[49087]: Authorization required, but no authorization protocol specified
dec. 07 18:33:20 smith sh[49087]: Authorization required, but no authorization protocol specified
dec. 07 18:33:13 smith sh[49085]: Authorization required, but no authorization protocol specified
dec. 07 18:33:13 smith sh[49085]: Authorization required, but no authorization protocol specified
I resolved it by adding another line in the shell script : export XAUTHORITY='/run/lightdm/root/:0'
Indeed
❯ ps aux | grep Xorg (/run/lightdm/root/:0
is after -auth
in the first line)
root 1124 4.1 2.7 25744332 218424 tty7 Ssl+ 12:41 15:29 /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
<username> 51551 0.0 0.0 6572 2520 pts/4 S+ 18:56 0:00 grep Xorg
I do not really like it, because normally (before the export above) XAUTHORITY
was equal to /home/<username>/.Xauthority
EDIT : it also works when i add export XAUTHORITY='/home/<username>/.Xauthority'
in the shell script (nfancurve.sh, i also get it from AUR), but i do not really understand what is happening with this XAUTHORITY thing.
Have you faced this issue too ?
Thanks
from nfancurve.
Related Issues (20)
- Only one fan of three detected HOT 5
- Harmless but constant error warning HOT 2
- Does not autostart with the systemd user service enabled HOT 10
- Exit script HOT 4
- VDR is crashing with cuvid enabled. HOT 2
- systemd service fails to start HOT 3
- Hysteresis HOT 1
- Division by Zero When Executing temp.sh HOT 1
- Error when starting Script HOT 15
- Theme parsing error and Error assigning value to attribute HOT 1
- What a mess HOT 1
- 146 Syntax error: redirection unexpected HOT 10
- Min temps does not seem to work HOT 1
- Could you please create a new release ? HOT 2
- usage issues - xorg.conf, service autostart HOT 4
- Fan speed does not back to 0 HOT 1
- nvidia-settings allows setting the fan speed from 30% to 100% HOT 3
- headless support suggestion
- nfancurve doesn't keep fan speed as it should when set to low values <30%, speed keeps dropping to 0% HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nfancurve.