Baffling Linuxconf Behavior

I recently compiled and installed squid in /usr/local/squid on a box at my school and modified the squid init.d script that comes in the Redhat squid RPM distribution to point to the new file locations.  Startups, shutdowns and runtime level changes seems to work fine, but whenever I run Linuxconf, upon exiting it wants to stop the squid service.

I have checked /etc/rc.d/rc3.d and everything seems to be correct.  There is a S86squid soft link, but no K86squid.  I think I modified everything correctly in the /etc/rc.d/init.d/squid service control script, but I could be mistaken.

Does anyone have any insight into why Linuxconf would want to stop the squid service when it is not part of the /etc/rc.d/init.d runtime level definitions?

[root@heretic rc3.d]# ls (/etc/rc.d/rc3.d)
K10pulse    K30sendmail  K89portmap  S20random  S50inet      S90xfs
K20rstatd   K55routed    K91gpm      S30syslog  S75keytable  S99linuxconf
K20rusersd  K60lpd       S05kudzu    S40atd     S85httpd     S99local
K20rwhod    K75netfs     S10network  S40crond   S86squid

/etc/rc.d/init.d/squid (modified from Redhat 6.1 squid RPM)
# squid  This shell script takes care of starting and stopping
#  Squid Internet Object Cache
# chkconfig: - 90 25
# description: Squid - Internet Object Cache. Internet object caching is \
#  a way to store requested Internet objects (i.e., data available \
#  via the HTTP, FTP, and gopher protocols) on a system closer to the \
# requesting site than to the source. Web browsers can then use the \
# local Squid cache as a proxy HTTP server, reducing access time as \
# well as bandwidth consumption.
# pidfile: /var/run/
# config: /usr/local/squid/bin/squid/squid.conf

export PATH

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# check if the squid conf file is present
[ -f /usr/local/squid/etc/squid.conf ] || exit 0

# determine the name of the squid binary
[ -z "$SQUID" ] && exit 0

# determine which one is the cache_swap directory
CACHE_SWAP=`sed -e 's/#.*//g' /usr/local/squid/etc/squid.conf |
 grep cache_dir | sed -e 's/cache_dir//' | \
 cut -d ' ' -f 2`
[ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid

# default squid options
# -D disables initial dns checks. If you most likely will not to have an
#    internet connection when you start squid, uncomment this

case "$1" in
    echo -n "Starting $SQUID: "
    for adir in $CACHE_SWAP; do
        if [ ! -d $adir/00 ]; then
      echo -n "init_cache_dir $adir... "
      $SQUID -z -F 2>/dev/null
    /usr/local/squid/bin/squid $SQUID_OPTS &
    echo $SQUID
    echo ""
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SQUID

    echo -n "Stopping $SQUID: "
    /usr/local/squid/bin/squid -k shutdown &
    if [ $RETVAL -eq 0 ] ; then
     rm -f /var/lock/subsys/$SQUID
  while : ; do
  [ -f /var/run/ ] || break
  sleep 2 && echo -n "."
     echo "done"

    /usr/local/squid/bin/squid $SQUID_OPTS -k reconfigure
    exit $?

    $0 stop
    $0 start

    status $SQUID
    /usr/local/squid/bin/squid -k check
    exit $?

    exit 0;

    echo "Usage: $0 {start|stop|status|reload|restart}"
    exit 1

exit $RETVAL

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lavenAuthor Commented:
Edited text of question.
Manfred BertlManagerCommented:
try the program 'webmin' at whith this program, you can set the actions and programs in the runlevels in every way you want.
First of all when I setup squid to run using linuxconf, it puts the link file in as "/etc/rc.d/rc3.d/S90squid" linking of course to "../init.d/squid" which is your modified file.  You have called your startup file "S86squid" which conflicts with what linuxconf wants to call it (at least in my RH6.1 distribution).  Linuxconf checks your files in your rc3.d directory and other rcx.d directories for all runlevels in order to evaluate what is running.
The easiest way to solve your problem is to move your "/etc/rc.d/rc3.d/S86.squid" file(which by all rights works but conflicts with linuxconf and its naming convention) out of the /etc/rc.d/rc3.d subdirectory.  Then activate squid using the linuxconf program and it will create the link file for you, but it will still point to your modified "/etc/rc.d/init.d/squid" file.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

lavenAuthor Commented:
Sorry, I had already tried this.  Linuxconf seems to not care about the service number on the squid symlink in /etc/rc.d/rc3.d

I'm thinking some other possibilities could be in my /etc/rc.d/init.d/squid script.  Something like permission errors or script errors in not being able to correctly write and touch the .pid file or lock file in the /var filesystem.  Does linuxconf touch these, and could this lead to it wanting to stop the squid service?
Sorry, I didn't read your message close enough the first time.  You will not have a kill script for squid in rc3.d, but in rc0.d and rc6.d.  I believe you are correct about your script file having problems though.  I think you may be running some combination of the original squid program program and your program.  Try changing the line "SQUID=squid" to "[ -f /usr/local/squid/bin/squid ] && SQUID=/usr/local/squid/bin/squid"  or change every occurence of where "$SQUID" is used to "/usr/local/squid/bin/squid"  The line below:
$SQUID -z -F 2>/dev/null
does invoke the squid program via the path in /usr/sbin!
I'm not an expert in squid and I don't see how it may affect linuxconf unless you are really running 2 versions of squid simultaneously, but I am pretty sure your script file is not correct.
I'm still trying to figure out what the "-z -F 2>/dev/null" does.  I think "-z -F" are squid options and "2>/dev/null" are directing stderr to /dev/null.
lavenAuthor Commented:
I know for sure that I am not running two simultaneous squid versions.  I am running the standard installation of squid when compiled from the source and "make install"ed.

After I have confirmed that squid is working properly, I thought about how I could have the service start automatically.  I examined how Redhat handled its service starts and stops and looked at the Redhat squid RPM (pre-compiled binary package).  Within that RPM it had a /etc/rc.d/init.d/squid script, so I figured it would be easy for me to modify this script for my own usage.

I admit the script edidting was a rush job, but the end result seemed to work fine in boots, shutdowns and runtime level changes.  This strange Linuxconf behavior is the only symptom.

The hard drive in that box just fried itself, so I will have to continue work on this tomorrow after I get a replacement from the local store.  If anyone else knows anything about this linuxconf behavior please feel free to post.

(Increasing question points)
I don't use linuxconf much at all. But have you made sure that you do not have not told linuxconf to kill squid and not changed that behaviour.
>  [ -f /var/run/ ] || break
you use this in your "stop" case, but never define/write this file
That's not the reason of your problem, but probably RedHat has a script which checks for such pid-files and then stops corresponding processes anyhow. Check the rc.local, rc.boot etc. scripts and/or linuxconf script (or whatever it is called on RedHat)
lavenAuthor Commented:
I found the problem late yesterday.  Apparently linuxconf had a problem with my script because my squid binary wasn't in my default path.  I changed all references to $SQUID to the full path of the binary, and somehow linuxconf no longer behaves strangely.

Now how do I close this thread?...
Manfred BertlManagerCommented:
you give the points to the person who's comment fits best.
That's what I was trying to tell you.  If you still had a copy of squid in /usr/bin it would try to refer to that one.  If it was not there, then of course it could not be used by the system as intended.  That's why I said to make everything referring to squid use "/usr/local/squid/bin/squid".

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fixed this question which was locked in a -1 error

Community Support Moderator
Experts Exchange
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.