LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-03-2010, 01:32 PM   #1
coolgreen1
Member
 
Registered: Nov 2007
Distribution: CentOS 5.5 x86_64 (Desktop) & Linux Mint 9 (Netbook)
Posts: 71

Rep: Reputation: 17
Where do i get Chkconfig


Hi,

I am installing Folding@Home and it says for the last step I need Chkconfig to run this command
Code:
s u - -c "chkconfig --add folding"
. I checked SlackBuilds but the link they provide to the source is dead and i cannot find the version to use the SlackBuild script with anywhere. I tried an older version with the SlackBuild Script but it fails.

Any help would be greatly appreciated.

Last edited by coolgreen1; 05-05-2010 at 04:47 AM.
 
Old 05-03-2010, 01:34 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
You don't need this on slackware, just add folding to your start up scripts like any other program. chkconfig is a redhat/derived thing. Basically that command tells it "Add the folding script to the allowed start up programs" and I imagine the next command is something like "chkconfig folding on".

Last edited by rweaver; 05-03-2010 at 01:35 PM.
 
Old 05-03-2010, 05:50 PM   #3
coolgreen1
Member
 
Registered: Nov 2007
Distribution: CentOS 5.5 x86_64 (Desktop) & Linux Mint 9 (Netbook)
Posts: 71

Original Poster
Rep: Reputation: 17
Hi,

How would I do this? Would I just add it in my rc.d directory and make it executable. I have it in my init.d directory right now, do i leave it here.
 
Old 05-03-2010, 05:58 PM   #4
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
We'd need to see the contents of the file that was placed in init.d but generally you'd add the start-up command for custon programs to /etc/rc.d/rc.local

The correct course of action would depend on how "generic" the start-up script is.
 
Old 05-03-2010, 07:33 PM   #5
coolgreen1
Member
 
Registered: Nov 2007
Distribution: CentOS 5.5 x86_64 (Desktop) & Linux Mint 9 (Netbook)
Posts: 71

Original Poster
Rep: Reputation: 17
Hi,

So to start it as a service I would just enter this script into rc.local? Also, I have removed it from the rc.d folder and init.d folder and it is now in my home folder where it was first made following the F@H instructions, should I put it back?

Code:
# chkconfig: 345 93 14
# description: will start FAH client as a service
su - USERNAME -c "cd /home/USERNAME/folding; ./fah6 < /dev/null > 
/dev/null 2>&1 &"

Last edited by coolgreen1; 05-03-2010 at 07:36 PM.
 
Old 05-03-2010, 08:05 PM   #6
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 906

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
I used to run folding at home, and this is the script I had in /etc/rc.d (I named it rc.fah):
Code:
#!/bin/sh
#
# Start/stop FAH

FAH_DIR=/home/folder/folding/
FAH_EXEC=fah6
FAH_USER=folder
FAH_OPTIONS="-smp -verbosity 9"
#FAH_OPTIONS="-smp -verbosity 9 -oneunit"

test -x $FAH_DIR$FAH_EXEC || exit 0

case "$1" in
    start)
        echo -n "Starting folding@home client"
        su - $FAH_USER -c "cd $FAH_DIR; nohup ./$FAH_EXEC $FAH_OPTIONS >/dev/null 2>&1 &"
        echo "."
        ;;
    stop)
        echo -n "Stopping folding@home client"
        kill -15 `pidof -s $FAH_EXEC`
        sleep 10
        echo "."
        ;;
    *)
        echo "Usage: /etc/rc.d/rc.fah {start|stop}"
        exit 1
        ;;
esac

exit 0
And then add the following to rc.local:
Code:
#
# If we're not on battery:
#  Up min CPU speed       
#  Start folding          
#
ACSTATE=`cat /sys/class/power_supply/AC/online`
if [ "$ACSTATE" == "1" ]; then
#  echo "Setting min CPU speed to 800MHz..."
#  echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
  if [ -x /etc/rc.d/rc.fah ]; then
    /etc/rc.d/rc.fah start
  fi
fi
You might want to edit that if you're not on a laptop.

And the following to rc.local_shutdown:
Code:
# Stop FAH
# We really don't need to check if it's executable
# or not, really.                                 
if [ -x /etc/rc.d/rc.fah ] ; then                 
  /etc/rc.d/rc.fah stop                           
fi
Wow that's a funny comment I left myself there.
 
Old 05-05-2010, 04:46 AM   #7
coolgreen1
Member
 
Registered: Nov 2007
Distribution: CentOS 5.5 x86_64 (Desktop) & Linux Mint 9 (Netbook)
Posts: 71

Original Poster
Rep: Reputation: 17
Hi,

I have solved my problem. Turns out I just had to put the entire script on one line in rc.local. Thank you all for your help!
 
Old 05-05-2010, 02:39 PM   #8
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Just as a general heads up... no need to put it on one line in rc.local... you can append it to the file or even put it in /usr/local/sbin or something and call it from rc.local...
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I get "bash: chkconfig: command not found" when I try to run chkconfig? non-thrash Fedora 10 05-20-2010 12:31 PM
Chkconfig henkoegema Linux - Software 2 12-19-2009 04:21 AM
chkconfig ?? vonedaddy Linux - Newbie 2 11-07-2007 11:44 PM
chkconfig ?? jchin Linux - Newbie 4 10-16-2003 01:59 AM
Help on chkconfig ztopher Linux - Software 0 04-09-2003 03:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration