Skip to content

Instantly share code, notes, and snippets.

@sayoder
Last active March 17, 2020 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayoder/0499cb2a096cc1bf4efe0a0815347b5b to your computer and use it in GitHub Desktop.
Save sayoder/0499cb2a096cc1bf4efe0a0815347b5b to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Modifying BBB ruby code..."
cd /usr/local/bigbluebutton/core/scripts
mv rap-process-worker.rb rap-process-worker.rb.bak
curl -O https://gist.githubusercontent.com/MortimerMcMire315/d94cc25f446b1a6b0857ebd8f02f8e0b/raw/291dff18c1c740c0ecffea3780ffb89d36196b32/rap-process-worker.rb
chmod +x rap-process-worker.rb
echo "Creating 10 worker processes..."
cd /usr/lib/systemd/system
for i in {0..9}; do
cp bbb-rap-process-worker.service bbb-rap-process-worker-$i.service
done
mv bbb-rap-process-worker.service bbb-rap-process-worker.bak
for i in {0..9}; do
sed -i -re "s/rap-process-worker.rb/rap-process-worker.rb -p '${i}$'/" bbb-rap-process-worker-$i.service
done
mv bbb-record-core.target bbb-record-core.bak
echo "Installing new bbb-record-core.target..."
cat <<EOF > bbb-record-core.target
[Unit]
Description=BigBlueButton recording & playback processing
Wants=bbb-rap-archive-worker.service bbb-rap-sanity-worker.service bbb-rap-process-worker-0.service bbb-rap-process-worker-1.service bbb-rap-process-worker-2.service bbb-rap-process-worker-3.service bbb-rap-process-worker-4.service bbb-rap-process-worker-5.service bbb-rap-process-worker-6.service bbb-rap-process-worker-7.service bbb-rap-process-worker-8.service bbb-rap-process-worker-9.service bbb-rap-publish-worker.service bbb-rap-events-worker.service
StopWhenUnneeded=true
EOF
echo "Reloading systemctl..."
systemctl daemon-reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment