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

Service exit after start #1

Open
ghost opened this issue Oct 3, 2018 · 6 comments
Open

Service exit after start #1

ghost opened this issue Oct 3, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Oct 3, 2018

Hello,

I always get service active(exited):
● cpufan.service - LSB: CPU fan service
Loaded: loaded (/etc/init.d/cpufan; generated; vendor preset: enabled)
Active: active (exited) since Wed 2018-10-03 10:57:36 WEST; 16min ago
Docs: man:systemd-sysv-generator(8)
CGroup: /system.slice/cpufan.service

Any clue?

@MrBiz
Copy link
Owner

MrBiz commented Oct 3, 2018

What OS are you running?

Active: active (exited) means that the service is running but the system doesn't understand or can't see the daemon to monitor it (i'm not seeing the same thing on mine). If you run a "sudo service --status-all" you may probably see this "[ - ] cpufan" instead of this "[ + ] cpufan".

If you check the logfile /var/log/cpufan.log it should show when the CPU fan speed was updated, if it's recent then the service is running anyway.

The daemon is located "/var/run/cpufan.pid" see if it is created or not and if it is readable etc?

You also don't have to run the fan as a service you can just run the "fan.py" script at startup in a cron job or from the command line and the fan should start up.

I'm not going to close this issue yet as I will look into writing a unit file for the service that should stop this monitoring quirk.

Thanks for your help :)

@Afterschnitzel
Copy link

Afterschnitzel commented Dec 2, 2020

Same problem here with Raspberry Pi4.
/var/log/cpufan.log is empty

pi@raspberry:~ $ sudo service cpufan status
● cpufan.service - LSB: CPU fan service
   Loaded: loaded (/etc/init.d/cpufan; generated)
   Active: active (exited) since Wed 2020-12-02 21:23:11 CET; 36s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 356 ExecStart=/etc/init.d/cpufan start (code=exited, status=0/SUCCESS)

pro 02 21:22:56 raspberry systemd[1]: Starting LSB: CPU fan service...
pro 02 21:22:56 raspberry cpufan[356]: Starting service…
pro 02 21:22:57 raspberry su[362]: (to root) root on none
pro 02 21:22:57 raspberry su[362]: pam_unix(su:session): session opened for user root by (uid=0)
pro 02 21:23:11 raspberry cpufan[356]: Service started
pro 02 21:23:11 raspberry systemd[1]: Started LSB: CPU fan service.

@MrBiz
Copy link
Owner

MrBiz commented Dec 3, 2020

I've not had the pleasure of running it on a pi4 yet.
Does the fan actually run and vary speed or just full speed or not at all? what happens if you just run fan.py (any errors)?

This may also be as simple as running the service as the "pi" user rather than root due to Raspbian changes with the Root account.

change line 13 in the cpufan file
RUNAS=root
to
RUNAS=pi

and run the commands:
sudo systemctl daemon-reload
sudo service cpufan start

@Afterschnitzel
Copy link

Afterschnitzel commented Dec 9, 2020

Hi. If i run fan.py, it runs at full speed, but program measure RPM.
If I swap cables on pins, it works. But fan RPMs are fluctuating and program does not measure RPM.

And RUNAS=pi does not work for me :-(

@MrBiz
Copy link
Owner

MrBiz commented Dec 9, 2020

You are using the transistor as a controller right?
Out of curiosity what are the colors of the wires on your fan?
Sounds like I may need to get a Pi4.

@Afterschnitzel
Copy link

Yes, I am using transistor.
And wires are - black, red, yellow - NOCTUA NF-A4x10 5V 3-pin

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

No branches or pull requests

2 participants