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

fix(freepbx_init.sh): install modules as asterisk user #339

Merged
merged 4 commits into from
Dec 16, 2024
Merged

Conversation

Stell0
Copy link
Collaborator

@Stell0 Stell0 commented Nov 21, 2024

  • Use asterisk user instead of root to install module at first start
  • This should avoid random bug that prevent freepbx reload untill container is restarted

NethServer/dev#7191

- Use asterisk user instead of root to install module at first start
- This should avoid random bug that prevent freepbx reload untill container is restarted
@Stell0 Stell0 requested a review from Amygos November 21, 2024 17:22
@Amygos
Copy link
Member

Amygos commented Dec 2, 2024

the module from the PR produces this error once configured:

Dec 02 16:38:16 node.example.com freepbx[89936]: [2024-12-02 17:38:16] [freepbx.INFO]: Deprecated way to add Console commands for module backup, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []
Dec 02 16:38:16 node.example.com freepbx[89936]: [2024-12-02 17:38:16] [freepbx.INFO]: Deprecated way to add Console commands for module pm2, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []
Dec 02 16:38:16 node.example.com freepbx[89936]: [2024-12-02 17:38:16] [freepbx.INFO]: [NOTIFICATION]-[core]-[SWAP] - No Swap (Your system has no swap space. This should be fixed as soon as possible. Once fixed issue a reload to remove this message) [] []
Dec 02 16:38:17 node.example.com freepbx[89936]: 
Dec 02 16:38:17 node.example.com freepbx[89936]: In Reload.class.php line 622:
Dec 02 16:38:17 node.example.com freepbx[89936]:                               
Dec 02 16:38:17 node.example.com freepbx[89936]:   mkdir(): Permission denied  
Dec 02 16:38:17 node.example.com freepbx[89936]:                               
Dec 02 16:38:17 node.example.com freepbx[89936]: 
Dec 02 16:38:17 node.example.com freepbx[89936]: reload [--json] [--dry-run] [--skip-registry-checks] [--dont-reload-asterisk]
Dec 02 16:38:17 node.example.com freepbx[89936]: 
Dec 02 16:38:17 node.example.com freepbx[89936]: [2024-12-02 17:38:17] [freepbx.INFO]: [NOTIFICATION]-[freepbx]-[RCONFFAIL] - 'fwconsole reload' failed, config not applied (mkdir(): Permission denied) [] []

The nethcti-server service is on a restart loop:

Dec 02 16:41:48 node.example.com systemd[85070]: Starting NethCTI server daemon...
Dec 02 16:41:50 node.example.com systemd[85070]: Started libcrun container.
Dec 02 16:41:50 node.example.com systemd[85070]: Started libcrun container.
Dec 02 16:41:50 node.example.com podman[101090]: ab0ce2e8d39c3c8591980595529a193a5b94561187b9c7f76d5e703647d9b7a2
Dec 02 16:41:50 node.example.com systemd[85070]: Started NethCTI server daemon.
Dec 02 16:41:50 node.example.com freepbx[89936]: [Dec  2 17:41:50] NOTICE[2761]: manager.c:3753 authenticate: 127.0.0.1 tried to authenticate with nonexistent user 'proxycti'
Dec 02 16:41:50 node.example.com freepbx[89936]: [Dec  2 17:41:50] NOTICE[2761]: manager.c:3790 authenticate: 127.0.0.1 failed to authenticate as 'proxycti'
Dec 02 16:41:51 node.example.com nethvoice2[101101]: Configuration is not ready: server not started.
Dec 02 16:41:51 node.example.com podman[101137]: ab0ce2e8d39c3c8591980595529a193a5b94561187b9c7f76d5e703647d9b7a2
Dec 02 16:41:51 node.example.com systemd[85070]: nethcti-server.service: Consumed 1.813s CPU time.
Dec 02 16:41:51 node.example.com systemd[85070]: nethcti-server.service: Scheduled restart job, restart counter is at 68.
Dec 02 16:41:51 node.example.com systemd[85070]: Stopped NethCTI server daemon.
Dec 02 16:41:51 node.example.com systemd[85070]: nethcti-server.service: Consumed 1.813s CPU time.

- Launch fwconsole chown to let FreePBX change all permissions as it likes
@Stell0 Stell0 marked this pull request as ready for review December 5, 2024 08:48
@Stell0
Copy link
Collaborator Author

Stell0 commented Dec 5, 2024

Nope

Dec 05 11:43:02 makako freepbx[132465]: sh: 1: /var/www/html/freepbx/rest/lib/retrieveHelper.sh: Permission denied

- create freepbx chown configuration file to exclude wizard
@Stell0 Stell0 merged commit e1a0777 into main Dec 16, 2024
4 checks passed
@Stell0 Stell0 deleted the Stell0-patch-1 branch December 16, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants