You are not logged in.

#1 2014-11-07 13:50:55

d33p_th0ught
Member
Registered: 2014-11-07
Posts: 14

[SOLVED] autostart programm as root

I have a little c program to control the fan speed that i would like to run on startup.

The file is placed in /usr/bin/ and can be run with 'sudo yoga_fan'.

Any idea how to autostart this program?


I allready tried to start it with systemctl but without success.
i created the file /etc/systemd/system/yoga_fan.service:

[Unit]
Description=Yoga Fan Control
[Service]
ExecStart=/usr/bin/yoga_fan
[Install]
WantedBy=multi-user.target

and enabled it with:

sudo systemctl enable yoga_fan.service

Last edited by d33p_th0ught (2014-11-07 15:02:16)

Offline

#2 2014-11-07 14:38:02

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: [SOLVED] autostart programm as root

I'm by no means a systemd guru, but try adding

[Service]
Type=forking

assuming your program forks into the background. Otherwise, use the correct Type setting and a timer if necessary.

Failing that, can you be more specific about "without success"? Post the output of `systemctl status yoga_fan` and/or describe what's not working.

Edit: keep in mind that enabling a service does not implicitly start it immediately.

Last edited by EscapedNull (2014-11-07 14:38:59)

Offline

#3 2014-11-07 15:00:21

d33p_th0ught
Member
Registered: 2014-11-07
Posts: 14

Re: [SOLVED] autostart programm as root

Thanks, that solved the problem smile

Offline

Board footer

Powered by FluxBB