Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th March 2012, 10:30 AM
fr3sh Offline
Registered User
 
Join Date: Jul 2011
Posts: 6
linuxfirefox
chkconfig do not wont to start my script

Hi

I write a little script that I would like to autostart after boot. I very simple one. It's only try to start other script thats start the program Couchpotato. Program I can normaly start by command "pytchon Couchpotato -d" its also works when I put this inside my sh script but it's not working inside chkonfig. Please healp.


I put this scrip inside /etc/init.d next run command:
chkconfig --add myscript.
After that:
chkconfig --level 345 myscript on.
Restart fedora do not autostart the service .
service myscript start <- say OK but not working
What to do?

Here is simple script:

PHP Code:
#!/bin/sh

# chkconfig: - 21 79
# description: Ziemniak

exec="/down/couch/CouchPotato.py"
prog="SABnzbd"

#if [ -f /down/couch/config.ini ]; then
    #    . /down/couch/config.ini
#fi

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

start
() {

    echo -
$"Starting $prog: "
     
# . cd /down/couch
    # CouchPotato.py -d   ##### dont work 
   
daemon --user=fr3sh $exec --/down/couch/config.ini   ####also dont work
    
retval=$?
    echo
    return 
$retval
}

stop() {

}

restart() {
    
stop
    start
}

reload() {
    
restart
}

force_reload() {
    
restart
}


case 
"$1" in
    start
)
    
start
        
$1
        
;;
    
stop)
        $
1
        
;;
    
restart)
        $
1
        
;;
    
reload)
        $
1
        
;;
    
force-reload)
        
force_reload
        
;;
    
status)
        ;;
    
condrestart|try-restart)
        ;;
    *)
        echo $
"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
        
exit 2
esac
exit $? 
Reply With Quote
  #2  
Old 18th March 2012, 01:04 PM
smr54 Offline
Registered User
 
Join Date: Jan 2010
Posts: 4,976
linuxchrome
Re: chkconfig do not wont to start my script

I'm not exactly sure what changes systemd has made. As you probably know, the old sysinit has been replaced by systemd, which has made many changes.

I haven't kept up on what, if any, changes have to be made to custom init scripts. I'm lazy that way, and usually just add them to /etc/rc.local.
Reply With Quote
  #3  
Old 18th March 2012, 03:42 PM
DBelton's Avatar
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 6,613
linuxfirefox
Re: chkconfig do not wont to start my script

did you set your init script to be executable (chmod +x myscript)?
Reply With Quote
  #4  
Old 18th March 2012, 08:58 PM
fr3sh Offline
Registered User
 
Join Date: Jul 2011
Posts: 6
linuxfirefox
Re: chkconfig do not wont to start my script

Yes. The scrip even has permission set to 777

Ps. I'm using fedora 16

---------- Post added at 08:58 PM ---------- Previous post was at 05:06 PM ----------

Thats strange. When the function is empty there is an error on close "}". I add something into stop function and once he start properly. But after reboot he didnt start properly. I must run chkconfig myscript stop then systemctl --system daemon-reload after that when i run service myscript start he start ok. What's going on?
Reply With Quote
  #5  
Old 19th March 2012, 08:16 PM
stevea's Avatar
stevea Online
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,300
linuxfedorafirefox
Re: chkconfig do not wont to start my script

Try adding an LSB header
http://fedoraproject.org/wiki/Packag...ipt#LSB_Header
systemd uses thenm if available.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
Reply

Tags
chkconfig, script, start

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] chkconfig / script help Diametric Using Fedora 7 23rd July 2011 11:04 PM
[SOLVED] chkconfig script Keldorn Using Fedora 3 17th June 2010 05:12 PM
chkconfig messes priorities - half of the services fail to start duni Alpha - Beta (Fedora 9 Only) 1 18th May 2008 06:41 AM
The difference between service start and chkconfig kurtshi Servers & Networking 6 6th April 2008 05:11 AM
disabling startup script which is not listed in chkconfig alphonsebrown Using Fedora 3 26th March 2005 08:12 PM


Current GMT-time: 23:17 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat