BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001464 [BusyBox] Networking Support minor always 08-14-07 15:59 08-27-07 04:53
Reporter lvalter View Status public  
Assigned To BusyBox
Priority normal Resolution unable to reproduce  
Status closed   Product Version
Summary 0001464: [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.
Additional Information
Attached Files

- Relationships

- Notes
(0002689)
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?
 
(0002692)
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 :-)
 
(0002694)
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.
 
(0002696)
lvalter
08-26-07 14:31

Sorry ... :-(
It's work perfectly
Thanks a lot for your assistance.
The next time, y dont forget to use my brain.
 

- 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
08-26-07 14:31 lvalter Note Added: 0002696
08-27-07 04:53 vda Status feedback => closed
08-27-07 04:53 vda Resolution open => unable to reproduce


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker