Bogus I-Cap System V-like init script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
c-icap (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hi all,
I've noticed several problems after having installed c-icap on a fully-patched Ubuntu 11.04 (Proxy squid3, c-icap service, ClamAV-Daemon, and SquidClamav as a redirector). I've tried the c-icap package provided by Ubuntu, and the c-icap that I compiled from source: both seem to show the same behavior.
First: the command service c-icap start was not sometimes terminated properly since the "dot" at the end wasn't being displayed in the terminal. One could tell something was going wrong for there was unexpected icap errors while using the HTTP proxy).
Furthermore, the "service start" command, most of the time, returns an error:
root@proxy-
Starting c-icap: ERROR.
Whereas the c-icap's processes do run in memory:
root@proxy-
root 16772 0.0 0.1 2516 676 pts/1 S 23:14 0:00 /usr/local/
root 16773 0.0 0.0 92684 416 pts/1 Sl 23:14 0:00 /usr/local/
root 16774 0.0 0.0 92684 416 pts/1 Sl 23:14 0:00 /usr/local/
root 16775 0.0 0.0 92684 416 pts/1 Sl 23:14 0:00 /usr/local/
And the ICAP service is indeed working at this time.
The thing is, looking closer at the System V-like script execution, it seems that the error comes from the line:
[ ! -f "$PIDFILE" ] && return 1
since the function apparently finishes its execution at this point.
Nonetheless, the PID file is present in /var/run/c-icap at the end.
BTW, if you start the service, whatever the output is, and then start it a second time, there is no "already running" message, but nothing...
root@proxy-
Starting c-icap: ERROR.
root@proxy-
Starting c-icap: root@proxy-
Note the truncated end of the script output.
AFAIU this is quite abnormal.
Many thanks.
Cheers,
PS:
/usr/local/
then
killall c-icap
work like a charm :(
description: | updated |
summary: |
- Bogus I-Cap service System V-like script + Bogus I-Cap System V-like init script |
description: | updated |
description: | updated |
Guys,
Getting closer to the issue.
If I add prompts to see what's going on, let's say:
case "$1" in
check_ ctl_dir
start)
echo -n "Starting $DESC: "
echo -n "DAEMON : $DAEMON\n"
echo -n "DAEMON_OPTS : $DAEMON_OPTS\n"
if running ; then
echo "$NAME."
else
echo " ERROR."
fi
;;
And:
running()
{
# Check if the process is running looking at /proc
# (works for all users)
# No pidfile, probably no daemon present
echo -n "PIDFILE, $PIDFILE"
ls /var/run/c-icap
[ ! -f "$PIDFILE" ] && return 1
[...]
Here is the output (after having stopped the service):
root@proxy- ubuntu: /# service c-icap start bin/c-icap icap/c- icap.conf -d 2 c-icap/ c-icap. pid
Starting c-icap: DAEMON : /usr/local/
DAEMON_OPTS : -f /etc/c-
PIDFILE, /var/run/
c-icap.ctl
ERROR.
As you can see, there is no ".pid" file in /var/run/c-icap!
I guess this is why the script terminates itself when checking the pid file.