View Issue Details

IDProjectCategoryView StatusLast Update
0004339Talerobsolete componentpublic2016-04-04 16:03
ReporterChristian Grothoff Assigned ToMarcello Stanisci Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Version0.0 
Target Version0.0Fixed in Version0.0 
Summary0004339: sending SIGTERM to taler-bank-manage doesn't kill HTTP server
DescriptionThe shell script wrapper needs to catch the signal and kill the subprocess, or maybe better, simply 'exec' the HTTP server.

Right now, sending SIGTERM to taler-bank-manage leaves the Python server running, which is not OK.
TagsNo tags attached.
Attached Files
dump.txt (3,081 bytes)   
marcello@daemon:~$ netstat -l -t -n -p
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:39600           0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:8081          0.0.0.0:*               LISTEN      21523/python    
tcp        0      0 127.0.0.1:8888          0.0.0.0:*               LISTEN      1089/firefox    
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::111                  :::*                    LISTEN      -               
tcp6       0      0 :::80                   :::*                    LISTEN      -               
tcp6       0      0 :::58320                :::*                    LISTEN      -               
tcp6       0      0 ::1:8118                :::*                    LISTEN      -               
tcp6       0      0 ::1:5432                :::*                    LISTEN      -               
tcp6       0      0 :::25                   :::*                    LISTEN      -               
marcello@daemon:~$ kill 21523
marcello@daemon:~$ netstat -l -t -n -p
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:39600           0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:8888          0.0.0.0:*               LISTEN      1089/firefox    
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::111                  :::*                    LISTEN      -               
tcp6       0      0 :::80                   :::*                    LISTEN      -               
tcp6       0      0 :::58320                :::*                    LISTEN      -               
tcp6       0      0 ::1:8118                :::*                    LISTEN      -               
tcp6       0      0 ::1:5432                :::*                    LISTEN      -               
tcp6       0      0 :::25                   :::*                    LISTEN      -               
marcello@daemon:~$ 
dump.txt (3,081 bytes)   

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Florian Dold

2016-03-23 13:18

manager   ~0010322

Depending on the version of uwsgi, you simply need to run uwsgi with --die-on-term.

The stuff in deployment.git already does this, and the taler-bank-manage should do it as well ...

Marcello Stanisci

2016-03-23 13:39

reporter   ~0010324

fixed in 66ca238

Christian Grothoff

2016-03-23 17:16

manager   ~0010327

Does not work here.

Christian Grothoff

2016-03-23 17:16

manager   ~0010328

Please run 'make check' in bank-lib/ of taler-exchange and confirm that no process listening to port 8081 remains after the test. Otherwise, this is NOT fixed.

Florian Dold

2016-03-23 17:30

manager   ~0010329

Should be fixed in 5ba331, it appears the --master argument to uwsgi was missing ...

Christian Grothoff

2016-03-23 18:00

manager   ~0010331

No, still doesn't work for me. Did you test it as I suggested?

Christian Grothoff

2016-04-01 19:11

manager   ~0010353

Still does not work.

Marcello Stanisci

2016-04-02 15:49

reporter   ~0010355

That's completely normal: what happened is that Florian fixed the via-wsgi bank's launcher (used to make the bank available to nginx), but you need the "pure" bank launcher (called via the --bareserver option to taler-bank-manage), which launches the bank "natively" in django (see [1]). This native launcher
doesn't seem having any option to explicitly kill itself..

[1] https://docs.djangoproject.com/en/1.9/ref/django-admin/#runserver

Marcello Stanisci

2016-04-02 16:19

reporter   ~0010357

Last edited: 2016-04-02 16:19

Anyway, the attachment shows that the native server does die on SIGTERM (look for port 8081) ..

Christian Grothoff

2016-04-02 16:48

manager   ~0010358

It's not about an option. The issue is that the shell script needs to be modified to pass the signal to the child process.

See http://www.linuxquestions.org/questions/programming-9/signal-handling-from-bash-257157/

Marcello Stanisci

2016-04-04 12:17

reporter   ~0010364

found this also

http://unix.stackexchange.com/questions/146756/forward-sigterm-to-child-in-bash

Marcello Stanisci

2016-04-04 13:48

reporter   ~0010365

fixed in 0be5301

Solved by executing the server via 'exec' and by adding a '--noreload' flag which prevents the server from forking and getting trickier to kill.

Issue History

Date ModifiedUsernameFieldChange
2016-03-23 10:26Christian GrothoffNew Issue
2016-03-23 10:26Christian GrothoffStatusnew => assigned
2016-03-23 10:26Christian GrothoffAssigned To => Marcello Stanisci
2016-03-23 13:18Florian DoldNote Added: 0010322
2016-03-23 13:39Marcello StanisciNote Added: 0010324
2016-03-23 13:39Marcello StanisciStatusassigned => informing
2016-03-23 13:39Marcello StanisciResolutionopen => fixed
2016-03-23 16:03Christian GrothoffStatusinforming => closed
2016-03-23 16:03Christian GrothoffFixed in Version => 0.0
2016-03-23 17:16Christian GrothoffNote Added: 0010327
2016-03-23 17:16Christian GrothoffNote Added: 0010328
2016-03-23 17:16Christian GrothoffStatusclosed => feedback
2016-03-23 17:16Christian GrothoffResolutionfixed => reopened
2016-03-23 17:27Florian DoldAssigned ToMarcello Stanisci => Florian Dold
2016-03-23 17:27Florian DoldStatusfeedback => assigned
2016-03-23 17:30Florian DoldNote Added: 0010329
2016-03-23 17:30Florian DoldStatusassigned => feedback
2016-03-23 18:00Christian GrothoffNote Added: 0010331
2016-03-23 18:00Christian GrothoffStatusfeedback => assigned
2016-04-01 19:11Christian GrothoffAssigned ToFlorian Dold => Marcello Stanisci
2016-04-01 19:11Christian GrothoffNote Added: 0010353
2016-04-02 15:49Marcello StanisciNote Added: 0010355
2016-04-02 16:16Marcello StanisciFile Added: dump.txt
2016-04-02 16:19Marcello StanisciNote Added: 0010357
2016-04-02 16:19Marcello StanisciNote Edited: 0010357
2016-04-02 16:48Christian GrothoffNote Added: 0010358
2016-04-04 12:17Marcello StanisciNote Added: 0010364
2016-04-04 13:48Marcello StanisciNote Added: 0010365
2016-04-04 13:48Marcello StanisciStatusassigned => informing
2016-04-04 13:48Marcello StanisciResolutionreopened => fixed
2016-04-04 16:03Christian GrothoffStatusinforming => closed
2022-08-23 18:26Christian GrothoffCategorybank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 00:23Christian GrothoffCategorypy bank (demonstrator, obsolete) => obsolete componet
2023-12-11 19:08Florian DoldCategoryobsolete componet => obsolete component