From 0042437ad06f719dc6356fa1a6e08972f5620856 Mon Sep 17 00:00:00 2001 From: danry25 Date: Sat, 29 Jul 2017 12:49:51 -0700 Subject: [PATCH] Added minimal OpenVZ support. (#107) --- debian/resources/switch/package-systemd.sh | 5 +++++ debian/resources/switch/source-systemd.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/debian/resources/switch/package-systemd.sh b/debian/resources/switch/package-systemd.sh index a984510..e0aebcb 100755 --- a/debian/resources/switch/package-systemd.sh +++ b/debian/resources/switch/package-systemd.sh @@ -2,6 +2,11 @@ apt-get remove -y --force-yes freeswitch-systemd cp "$(dirname $0)/source/freeswitch.service.package" /lib/systemd/system/freeswitch.service cp "$(dirname $0)/source/etc.default.freeswitch.package" /etc/default/freeswitch chmod 644 /lib/systemd/system/freeswitch.service +if [ -e /proc/user_beancounters ] +then + echo "Oh, your on OpenVZ! Setting a CPU Scheduler isn't possible :(" + sed -i -e "s/CPUSchedulingPolicy=rr/;CPUSchedulingPolicy=rr/g" /lib/systemd/system/freeswitch.service +fi systemctl enable freeswitch systemctl unmask freeswitch.service systemctl daemon-reload diff --git a/debian/resources/switch/source-systemd.sh b/debian/resources/switch/source-systemd.sh index b997cdc..82fce39 100755 --- a/debian/resources/switch/source-systemd.sh +++ b/debian/resources/switch/source-systemd.sh @@ -1,5 +1,10 @@ cp "$(dirname $0)/source/freeswitch.service.source" /lib/systemd/system/freeswitch.service cp "$(dirname $0)/source/etc.default.freeswitch.source" /etc/default/freeswitch +if [ -e /proc/user_beancounters ] +then + echo "Oh, your on OpenVZ! Setting a CPU Scheduler isn't possible :(" + sed -i -e "s/CPUSchedulingPolicy=rr/;CPUSchedulingPolicy=rr/g" /lib/systemd/system/freeswitch.service +fi systemctl enable freeswitch systemctl unmask freeswitch.service systemctl daemon-reload