[BusyBox 0001464]: [httpd] Hup signal don't works

bugs at busybox.net bugs at busybox.net
Sun Aug 26 20:52:10 UTC 2007


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1464 
====================================================================== 
Reported By:                lvalter
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1464
Category:                   Networking Support
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
====================================================================== 
Date Submitted:             08-14-2007 15:59 PDT
Last Modified:              08-26-2007 13:52 PDT
====================================================================== 
Summary:                    [httpd] Hup signal don't works
Description: 
Busybox 1.6.1
When a send a kill -1 <pid httpd>, my server crack.
The HUP option on compilation is ON.

The HUP signal specification dont works.
====================================================================== 

---------------------------------------------------------------------- 
 vda - 08-26-07 11:05  
---------------------------------------------------------------------- 
Works for me:

# strace -tt busybox httpd -f -vvv -p 8888
...
18:39:03.392960 listen(3, 9)            = 0
18:39:03.393030 open("/etc/httpd.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
18:39:03.393068 open("httpd.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No
such file or directory)
18:39:03.393105 rt_sigaction(SIGHUP, {0x808a895, [], SA_RESTART}, NULL, 8)
= 0
18:39:03.393146 accept(3, 0xffffd45c, [28]) = ? ERESTARTSYS (To be
restarted)

(I execute "kill -HUP `pidof busybox`" on another console)

18:39:07.240546 --- SIGHUP (Hangup) @ 0 (0) ---
18:39:07.240677 open("/etc/httpd.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
18:39:07.240848 open("httpd.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No
such file or directory)
18:39:07.241021 rt_sigaction(SIGHUP, {0x808a895, [], SA_RESTART}, NULL, 8)
= 0
18:39:07.241174 sigreturn()             = ? (mask now [])
18:39:07.241332 accept(3,

What happens when you do the same? 

---------------------------------------------------------------------- 
 lvalter - 08-26-07 13:34  
---------------------------------------------------------------------- 
I do the same (httpd is ln -s of busybox)
# strace -tt httpd -f -p 8888
...
22:11:48.095900 bind(3, {sa_family=AF_INET, sin_port=htons(8888),
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
22:11:48.096688 listen(3, 9)            = 0
22:11:48.097246 open("/etc/httpd.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
22:11:48.098017 open("httpd.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No
such file or directory)
22:11:48.098445 select(4, [3], NULL, NULL, NULL

(I execute on another console kill -HUP `pidof httpd`)

) = ? ERESTARTNOHAND (To be restarted)
22:17:37.173271 --- SIGHUP (Hangup) @ 0 (0) ---
22:17:37.174147 +++ killed by SIGHUP +++

.... Sorry :-) 

---------------------------------------------------------------------- 
 vda - 08-26-07 13:52  
---------------------------------------------------------------------- 
Your strace lacks rt_sigaction(SIGHUP....).

It should be there because in version 1.6.1, httpd.c:

static void sighup_handler(int sig)
{
        /* set and reset */
        struct sigaction sa;

        parse_conf(default_path_httpd_conf, sig == SIGHUP ? SIGNALED_PARSE
: FIRST_PARSE);
        sa.sa_handler = sighup_handler;
        sigemptyset(&sa.sa_mask);
        sa.sa_flags = SA_RESTART;
        sigaction(SIGHUP, &sa, NULL);   <============
}

...
#if ENABLE_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP
        sighup_handler(0);  <=============
#else
        parse_conf(default_path_httpd_conf, FIRST_PARSE);
#endif
...

You forgot to turn on FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-14-07 15:59  lvalter        New Issue                                    
08-14-07 15:59  lvalter        Status                   new => assigned     
08-14-07 15:59  lvalter        Assigned To               => BusyBox         
08-26-07 11:05  vda            Note Added: 0002689                          
08-26-07 11:18  vda            Status                   assigned => feedback
08-26-07 13:34  lvalter        Note Added: 0002692                          
08-26-07 13:52  vda            Note Added: 0002694                          
======================================================================




More information about the busybox-cvs mailing list