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