Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NethCTI 3: reload doesn't work anymore #5600

Closed
Stell0 opened this issue Mar 20, 2019 · 3 comments
Closed

NethCTI 3: reload doesn't work anymore #5600

Stell0 opened this issue Mar 20, 2019 · 3 comments
Labels
bug A defect of the software nethcti Relative to NethCTI client or server verified All test cases were verified successfully
Milestone

Comments

@Stell0
Copy link

Stell0 commented Mar 20, 2019

CTI implements reload, that is called from systemd unit launcing a SIGUSR1:

ExecReload=/bin/kill -SIGUSR1 $MAINPID

but since last version it is broken, because nethcti-server is launched now using SCL: nethesis/nethcti-server@697f997#diff-fc64ba2de59129244f02959218e85b18
Now, $MAINPID has SCL PID(32478 in this example):

# ps aux | grep [n]ode
asterisk 32478  0.0  0.0   4352   584 ?        Ss   19:44   0:00 /usr/bin/scl enable rh-nodejs10 node /usr/lib/node/nethcti-server/nethcti.js
asterisk 32483  1.2  4.2 885084 65236 ?        Sl   19:44   0:08 node /usr/lib/node/nethcti-server/nethcti.js

When SIGUSR1 arrive to scl, it dies killing its child.

Additional informations:

ExecReload=/usr/bin/pkill -SIGUSR1 -f -u asterisk '^node /usr/lib/node/nethcti-server/nethcti.js$'

this is tested and actually works, but is inelegant

  • Another possible solution suggested by @DavidePrincipi is to create a bash wrapper that load scl environment, fork, setsid() and chdir()
@Stell0 Stell0 added the bug A defect of the software label Mar 20, 2019
@Stell0 Stell0 added this to the NethVoice 14 milestone Mar 20, 2019
@alepolidori alepolidori added the nethcti Relative to NethCTI client or server label Mar 21, 2019
@alepolidori alepolidori self-assigned this Mar 21, 2019
alepolidori added a commit to nethesis/nethcti-server that referenced this issue Mar 29, 2019
alepolidori added a commit to nethesis/nethcti-server that referenced this issue Mar 29, 2019
alepolidori added a commit to nethesis/nethcti-server that referenced this issue Mar 29, 2019
@alepolidori alepolidori removed their assignment Mar 29, 2019
@alepolidori
Copy link

How to test

  • use systemctl reload nethcti-server
  • verify that the server reloads also looking at /var/log/asterisk/nethcti.log

alepolidori added a commit to nethesis/nethcti-server that referenced this issue Mar 29, 2019
alepolidori pushed a commit to nethesis/nethcti-server that referenced this issue Mar 29, 2019
nethesis/dev#5600

* Added new com_ipc module to overcome reload problem
* Fix npm modules versions
* nethcti-cli.js: exit 1 on error
@alepolidori alepolidori added the testing Packages are available from testing repositories label Mar 29, 2019
@nethbot
Copy link
Member

nethbot commented Mar 29, 2019

in 7.6.1810/nethesis-testing:

  • nethcti-server3-3.10.1-1.4.g81a2063.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.10.1-1.4.g81a2063.ns7.x86_64.rpm x86_64

@andrea-marchionni andrea-marchionni added verified All test cases were verified successfully and removed testing Packages are available from testing repositories labels Apr 1, 2019
@andrea-marchionni andrea-marchionni removed their assignment Apr 1, 2019
@nethbot
Copy link
Member

nethbot commented Apr 1, 2019

in 7.6.1810/nethesis-updates:

  • nethcti-server3-3.11.0-1.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.11.0-1.ns7.x86_64.rpm x86_64

@Stell0 Stell0 closed this as completed Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect of the software nethcti Relative to NethCTI client or server verified All test cases were verified successfully
Projects
None yet
Development

No branches or pull requests

4 participants