Bug 533144

Summary: 3proxy service does not shutdown/restart properly
Product: [Fedora] Fedora Reporter: pankaj pandey <pankaj86>
Component: 3proxyAssignee: Pavel Alexeev <pahan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: pahan
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.6-7.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-01 04:16:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
silly modifications to make the 3proxy service work
none
working 3proxy init file as in 3proxy-0.6-4.fc12.i686 rpm none

Description pankaj pandey 2009-11-05 11:05:12 UTC
Description of problem:
I an unable to shutdown the 3proxy service by doing 
# service 3proxy stop

Version-Release number of selected component (if applicable):
3proxy-0.6-3.fc12.x86_64

How reproducible:
Always

Steps to Reproduce:
1. start 3proxy. (# service 3proxy start)
2. try to stop or restart it (# service 3proxy stop)
3.
  
Actual results:
Stopping 3proxy:                                           [FAILED]
Stopping the service fails as can be seen through ps that it is still running
1 S root      2186     1  0  80   0 - 250958 hrtime 16:17 ?       00:00:00 /usr/bin/3proxy /etc/3proxy.cfg

Expected results:
The service should stop properly

Additional info:
doing 
# service 3proxy restart
causes additional 3proxy processess to start since the old processess are not killed. I have to manually kill them using
# killall 3proxy

Addititional info:
The 3proxy service does not work as expected if kept in the startup sequence in runlevel 5 (and also when changin networks). This is because during the init process the network is not up (NetworkManager start it late) and hence the 3proxy process does not acquire the correct dns configuration from some file in /etc (i dont remember exactly which one). The same problem used to occur in squid proxy and is overcome by reloading the squid configuration during network events as configured in the file
/etc/NetworkManager/dispatcher.d/20-squid
as provided by the squid package.
Hence i request you to add a similar file for 3proxy to reload/restart the 3proxy service on network up events.

Comment 1 pankaj pandey 2009-11-08 06:03:58 UTC
Created attachment 368004 [details]
silly modifications to make the 3proxy service work

The killproc function probably does not work because a proper pidfile is not created (so i replaced it with killall). Also I added a reload option to the usage to reload the configuration for 3proxy. (I'm attaching this just to motivate a faster resolution to the problem, i know my modifications are adhoc)

Also please add a file in /etc/NetworkManager/dispatcher.d/ make the service work while starting/switching networks (as reported in problem 2 in previous comment).

$ cat /etc/NetworkManager/dispatcher.d/40-3proxy
#!/bin/sh

if [ "$2" = "up" ]; then
	/sbin/service 3proxy restart || : # reload doesn't work
fi
#EOF

and while on it please also add the man pages available at http://www.3proxy.ru/doc/index.html into the package. Modifying 3proxy.cfg is impossible w/o the man-pages.

Thanks

Comment 2 Pavel Alexeev 2009-11-08 13:41:20 UTC
Firstly, thanks for the bugreport. But there already actually minimum 3 bugs :) Please, fill new bugs on new issue in the future.

(In reply to comment #1)
> The killproc function probably does not work because a proper pidfile is not
> created (so i replaced it with killall).
Yes, pidfile can't used there - more than one process started. I rewrote it.


> Also please add a file in /etc/NetworkManager/dispatcher.d/ make the service
> work while starting/switching networks (as reported in problem 2 in previous
> comment).
> 
> $ cat /etc/NetworkManager/dispatcher.d/40-3proxy
> #!/bin/sh
> 
> if [ "$2" = "up" ]; then
>  /sbin/service 3proxy restart || : # reload doesn't work
Strange. Does you test what "reload" not work?

Comment 3 pankaj pandey 2009-11-08 14:18:20 UTC
(In reply to comment #2)
> Firstly, thanks for the bugreport. But there already actually minimum 3 bugs :)
> Please, fill new bugs on new issue in the future.

I'm sorry for that. Will remember it in the future. 1 bug 1 bug-report

> > if [ "$2" = "up" ]; then
> >  /sbin/service 3proxy restart || : # reload doesn't work
> Strange. Does you test what "reload" not work?  

Yes,  i did try to test it. Here are the steps i followed:
1> Disable networking by right clicking on the NetworkManager icon
2> Kill all 3proxy processess. Then start the service.
3> Now enable networking
4> Internet doesn't work in browser
5> do # service 3proxy reload (killall -USR1 3proxy)
6> Internet still doesn't work in browser
7> do # service 3proxy restart (killall 3proxy; service 3proxy start)
8> Internet starts working in browser

I think 3proxy doesn't reload the dns configuration on reload, only the 3proxy.cfg is reloaded. If i remember correctly the same was true for squid also some time back (i think i read a bug report about it before, but can't find it now though).
Thanks

Comment 4 Pavel Alexeev 2009-11-08 19:11:07 UTC
Thank you for the dispatcher script, it included.
Man also.
Please try this build - http://koji.fedoraproject.org/koji/taskinfo?taskID=1795112

Comment 5 pankaj pandey 2009-11-09 08:04:47 UTC
Thanks for quickly fixing this up. Since i'm on 64 bit, i just extracted the scripts from the koji rpm. The init.d script seems to be working fine. However in the dispatcher script the "$2" is missing in the 'if' statement, only "" is there instead of "$2". It is showing up as:
	if [ "" = "up" ]; then
instead of 
	if [ "$2" = "up" ]; then

Comment 6 Pavel Alexeev 2009-11-09 09:43:36 UTC
Sorry, I forgot escape $ in content.
Try this http://koji.fedoraproject.org/koji/taskinfo?taskID=1795549 (x86_64 included)

Comment 7 pankaj pandey 2009-11-09 10:24:02 UTC
Thanks. Works great now.

Comment 8 Pavel Alexeev 2009-11-09 10:27:51 UTC
Ok.
Thank you for the help and testing.

Updates follow.

Comment 9 Fedora Update System 2009-11-09 13:44:05 UTC
3proxy-0.6-5.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/3proxy-0.6-5.fc10

Comment 10 Fedora Update System 2009-11-09 13:48:09 UTC
3proxy-0.6-5.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/3proxy-0.6-5.fc11

Comment 11 Fedora Update System 2009-11-09 13:50:22 UTC
3proxy-0.6-5.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/3proxy-0.6-5.fc12

Comment 12 Fedora Update System 2009-11-09 13:52:19 UTC
3proxy-0.6-5.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/3proxy-0.6-5.el5

Comment 13 Fedora Update System 2009-11-10 03:22:00 UTC
3proxy-0.6-5.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update 3proxy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/EL-5/FEDORA-EPEL-2009-0822

Comment 14 Bug Zapper 2009-11-16 15:08:13 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 15 pankaj pandey 2009-11-21 09:25:45 UTC
Hi,
I just did a fresh F12 install today (the beta install moved on to rawhide) and found a problem with the package.
Basically the package you created in Comment #6 3proxy-0.6-4.fc12.x86_64.rpm worked well, but the init file in the next package 3proxy-0.6-5.fc12.x86_64.rpm is reverted back to the previous one, and so it doesn't work now.
Sorry for being so late in discovering it. Please fix it.

Comment 16 Pavel Alexeev 2009-11-24 23:32:33 UTC
Oh sorry again. Please see this build http://koji.fedoraproject.org/koji/taskinfo?taskID=1828449
And if all ok, I'll push all updates.

Comment 17 pankaj pandey 2009-11-25 06:55:39 UTC
No, there still seems to be the same problem. The /etc/rc.d/init.d/3proxy file is still the old one and it doesn't work. The one in 3proxy-0.6-4 was correct and working well. Luckily i have a backup of that to keep it running.

Comment 18 Pavel Alexeev 2009-11-25 17:18:55 UTC
It seams I lost it...

(In reply to comment #17)
> Luckily i have a backup of that to keep it running.  
and koji also do not store built rpms for me... Please, can you attach there correct init-file to do not do same work again?

And thank you for help.

Comment 19 pankaj pandey 2009-11-26 07:04:42 UTC
Created attachment 373925 [details]
working 3proxy init file as in 3proxy-0.6-4.fc12.i686 rpm

Attached the working init file.
Thanks

Comment 21 pankaj pandey 2009-11-28 18:35:12 UTC
Seems good.

Comment 22 Fedora Update System 2009-11-28 22:53:06 UTC
3proxy-0.6-7.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/3proxy-0.6-7.el5

Comment 23 Fedora Update System 2009-11-28 22:53:46 UTC
3proxy-0.6-7.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/3proxy-0.6-7.fc10

Comment 24 Fedora Update System 2009-11-28 22:54:39 UTC
3proxy-0.6-7.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/3proxy-0.6-7.fc11

Comment 25 Fedora Update System 2009-11-28 22:55:03 UTC
3proxy-0.6-7.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/3proxy-0.6-7.fc12

Comment 26 Fedora Update System 2009-12-01 04:16:48 UTC
3proxy-0.6-7.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 27 Fedora Update System 2009-12-01 04:25:55 UTC
3proxy-0.6-7.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 28 Fedora Update System 2009-12-01 04:45:35 UTC
3proxy-0.6-7.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 29 Fedora Update System 2009-12-07 06:30:31 UTC
3proxy-0.6-5.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 30 Fedora Update System 2009-12-21 19:29:01 UTC
3proxy-0.6-7.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.