Quick chkconfig question

Place to discuss Fedora and/or Red Hat

Quick chkconfig question

Postby Copperhead » Thu Oct 30, 2003 3:45 am

This is kind of a moot point, as I already sym-linked everything, but is there a way to use chkconfig on self-compiled programs? I compiled postgre, mysql, and apache tonight, and I wanted to use chkconfig, but when I tried it, it gave me an error message. Is this utility only usable on Red hat packages, or is there a way to tweak the compilations to make use of it?
Copperhead
scripter
scripter
 
Posts: 83
Joined: Wed May 14, 2003 1:12 am
Location: Los Angeles, CA, USA

Postby agent007 » Thu Oct 30, 2003 6:54 am

Even if u compile, the relevant entries should be there....Btw, login as r00t [console] and type 'ntsysv' Maybe that will work..
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Copperhead » Thu Oct 30, 2003 8:02 am

Thanks 007...

`ntsysv` didn't work. It returned everything that chkconfig returned (all of the listings in /etc/init.d/ that were placed during RPM install) , but had none of the scripts that I placed in /etc/init.d.

There has to be a way to do this with either the scripts that came with the sources, or ones that you wrote yourself. On Debian, you could use the update-rc.d utility to do this, whether you had a *.deb or not, so I am imagining that Red Hat has a way to do something similar.
Copperhead
scripter
scripter
 
Posts: 83
Joined: Wed May 14, 2003 1:12 am
Location: Los Angeles, CA, USA

Postby Void Main » Thu Oct 30, 2003 9:30 am

You wouldn't use chkconfig on the binaries but with the scripts in /etc/rc.d/init.d. It is very easy to add your own sysv scripts or modify ones that came with a non-standard package. The biggest part of it is in the comment section at the top of the script. Look at some of the others. Then you do a "chkconfig --add scriptname". I believe there is a section in the Red Hat documentation that covers it if you search Red Hat's documentation on their site. In fact almost all the info you need is right in the chkconfig man page. Otherwise I'll try to write up a little HOWTO this evening.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Void Main » Thu Oct 30, 2003 6:44 pm

I just read through this thread again because I didn't have a lot of time this morning to look at it. I won't ask why you recompiled all of the apps. I assume just because you wanted the latest versions, even then I usually make RPMS out of them and install them that way so they can be managed. If it's just because you want different options compiled in different than the default I usually just download the SRPM and change the configure options in the spec file and then rebuild the RPM. In fact I have hacked out a couple of my own Apache custom patches (minor ones) and then just add them to the stock Red Hat SRPM and modify the spec file and create my own custom Apache RPM.

Regarding the init scripts, the easiest thing might just be to take the Red Hat default scripts for "mysqld", "postgresql", and "httpd" and then just update the paths in the scripts to point to the proper locations for your custom built apps. Here are the three Red Hat scripts:

http://voidmain.is-a-geek.net/files/scripts/init/

Just stick them in /etc/init.d, update paths, salt to taste, and then:

# chkconfig --add mysqld
# chkconfig --add postgresql
# chkconfig --add httpd
# chkconfig mysqld on
# chkconfig postgresql on
# chkconfig httpd on
# service mysqld start
# service postgresql start
# service mysqld start
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Copperhead » Thu Oct 30, 2003 10:37 pm

Thanks for the tips guys. I'll give those scripts a try tonight.
Copperhead
scripter
scripter
 
Posts: 83
Joined: Wed May 14, 2003 1:12 am
Location: Los Angeles, CA, USA


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 1 guest

cron