-
Notifications
You must be signed in to change notification settings - Fork 7.6k
feat(systemd): use native template units for prosody visitor instances #16656
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
base: master
Are you sure you want to change the base?
feat(systemd): use native template units for prosody visitor instances #16656
Conversation
|
@saghul can you review the changes ? |
|
Hi, thanks for your contribution! |
| for (( i=1 ; i<=${NUMBER_OF_INSTANCES} ; i++ )); | ||
| do | ||
| service prosody-v${i} restart | ||
| systemctl restart prosody-v@${i}.service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we can restart all services by systemctl restart prosody-v@*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed this will removes the redundant loop and uses one command to restart all instances.
| systemctl restart prosody-v@${i}.service | ||
| done | ||
| service jicofo restart | ||
| systemctl restart jicofo.service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jicofo.service can be just jicofo
| JICOFO_HOSTNAME=$(echo get jitsi-videobridge/jvb-hostname | sudo debconf-communicate jicofo | cut -d' ' -f2-) | ||
|
|
||
| # Install SystemD template unit (once, outside loop) | ||
| cp [email protected] /lib/systemd/system/[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to save it to the /usr/lib/systemd/system/[email protected], not just /lib.
|
@stokito i have made the the suggested changes |
|
@damencho can you please take a look at this |
saghul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I also want @damencho to take a look.
|
On a running system where I have prosody-v0 installed and running I did: And it did not restart my prosody-v0. |
|
|
|
Still nothing |
|
Check what shows the |
Yeah, seems it is not correct on my end. Will continue testing and will let you know how it goes. |
|
@damencho @stokito Thanks for testing! I've identified and fixed the issue. CauseThe template instances were never created or started. The script only copied the template file and created config directories, but never told systemd to actually start the service instances. Changes1. Added daemon-reload after copying template: cp [email protected] /usr/lib/systemd/system/[email protected]
systemctl daemon-reload2. Added instance creation in the config loop: for (( i=1 ; i<=${NUMBER_OF_INSTANCES} ; i++ )); do
# ... config creation ...
systemctl enable --now prosody-v@${i}.service # Creates and starts each instance
done3. Reverted to explicit restart loop: for (( i=1 ; i<=${NUMBER_OF_INSTANCES} ; i++ )); do
systemctl restart prosody-v@${i}.service
doneThe wildcard @damencho Could you please test again? Running |
|
@damencho can you please test it again |
This pull request updates the way multiple Prosody instances are managed for extra-large conference deployments by switching from per-instance systemd unit files to a single systemd template unit. This simplifies configuration, reduces duplication, and standardizes service management commands. The most important changes are grouped below:
Related issue: #16654
Systemd service management improvements:
prosody-vN.servicefiles with a single systemd template unit file[email protected], using%ias the instance placeholder throughout the unit configuration. (resources/extra-large-conference/[email protected], [1] [2] [3]resources/extra-large-conference/pre-configure.sh, resources/extra-large-conference/pre-configure.shR19-L23)systemctl restart [email protected]for each instance andsystemctl restart jicofo.service, aligning with modern systemd practices. (resources/extra-large-conference/pre-configure.sh, resources/extra-large-conference/pre-configure.shL59-R62)Configuration simplification:
sedreplacements on unit files, as the template unit now handles instance-specific configuration via%i. (resources/extra-large-conference/pre-configure.sh, resources/extra-large-conference/pre-configure.shR19-L23)These changes make managing multiple Prosody instances more maintainable and consistent.