** Description changed: + SRU justification : + + Impact : + When using invoke-rc.d stud restart, stud is not restarted + since the children processes are still holding open sockets since children are not + killed when SIGTERM is sent to the parent + + Fix : + Modify stud to handle termination of children upon reception of SIGTERM + + Test Case : + 1) Install stud + + 2) Create SSL certs with the following cmds: + $ openssl genrsa -des3 -passout pass:ubuntu -out server.key 2048 + $ openssl rsa -passin pass:ubuntu -in server.key -out server.key.insecure + $ mv server.key server.key.secure + $ mv server.key.insecure server.key + $ openssl req -new -key server.key -out server.csr -subj "/C=FR/ST=Denial/L=LeChesnay/O=Dis/CN=ubuntu" + $ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt + $ cp server.crt /etc/ssl/certs + $ cp server.key /etc/ssl/private + $ openssl req -new -x509 -nodes -keyout /etc/stud/stud.pem -out /etc/stud/stud.pem -days 3650 -subj "/C=FR/ST=Denial/L=LeChesnay/O=Dis/CN=ubuntu" + + 3) configure stud : + $ cat << EOF > /etc/stud/stud.conf + OPTIONS="-b 127.0.0.1,8445" + CERT="/etc/stud/stud.pem" + EOF + + 4) Start stud + $ sudo invoke-rc.d stud start + One parent and one child stud process should be present + + 5) Restart stud + $ sudo invoke-rc.d stud restart + With the fix, stud parent and child process will be restarted. Without the fix, no more + stud process will be present. + + Regression : + Minimal. Signal handler is enable for the parent process only. Triggered if + SIGTERM is received by the parent. + + Original description of the problem : + I guess it is a race condition, as /etc/init.d/stud stop; /etc/init.d/stud start shows the same problem while adding a "sleep 1" before the call to "do_start" fixes the problem. There is also a (unrelated) bug in the function "do_stop()": there is a variable notfound=1 but it is not set to "0" in the for loop (as is the case in 'do_start'). This causes the return value to be 1: - [ $notfound -eq 1 ] && return 1 + [ $notfound -eq 1 ] && return 1 But this has nothing to do with the restart problem as both return values 0 and 1 are in the same case statement, so no difference to program flow.
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1123950 Title: /etc/init.d/stud restart does not start the daemon To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/stud/+bug/1123950/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
