Ask Your Question

start script on boot fedora 16

asked 2012-01-18 18:31:51 -0500

samuaz gravatar image

updated 2012-02-02 03:50:45 -0500

FranciscoD_ gravatar image

hi people,

i have a problem i need start a script for my fan on boot, like a new service, but im try the add the next lines on my script:

#chkconfig: 345 85 15
#description: smcfancontrol

save it in /etc/init.d/

and in terminal:

chkconfig --add smcfancontrol

but if I do this, and reboot my system does not start again, I have to start with the live cd and delete my script smcFanControl to make the system start again.

I am doing wrong?.

also try to create a script that contains my root password and followed the command to start the script of the fan, and then add it to gnome-session-properties.

but does not work does not start with the login, the script is good because I can start it manually without problems

any idea

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-01-18 21:42:57 -0500

sagarun gravatar image

I think you are trying to create a init script, Have a look at this

Does your init script has options to start/stop/restart a service?

Fedora has moved from SysVInit scripts to systemd. You might want to create a systemd service file instead of a sysVinit script. see

edit flag offensive delete link more

answered 2012-01-21 12:01:08 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi samuaz,

You 're in the good way but your shell script isn't right. Firstable read man chkconfig For example:

#! /bin/bash
# smcfancontrol fan control     
# chkconfig: 345 85 15
# description: Activates/Deactivates fan
# Provides: <your info>
# Should-Start: <your info>
# Short-Description: <your info>
# Description: <your info>

# Source function library.
. /etc/init.d/functions

# local
. /$HOME

# See how we were called.
case "$1" in
    echo "the script UP "
    <your fan service>
    echo "the script DOWN"
    # this is an exmaple
    pkill <your fan service>
    echo "Usage: /etc/init.d/smcfancontrol {start|stop}"
    exit 1
exit 0


$ sudo chkconfig --level  345 85 15 smcfancontrol
$ sudo chkconfig --add smcfancontrol

And the last step, to check:

$ sudo chkconfig --list
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-01-18 18:31:51 -0500

Seen: 17,036 times

Last updated: Feb 02 '12