From 0396da80a8714e70b9280e3b7600d2d3a8bb706a Mon Sep 17 00:00:00 2001 From: Prateek Date: Thu, 9 Mar 2017 17:46:29 +0530 Subject: [PATCH] taking -self-ip as -bind ip --- scripts/start_mayaserver.sh | 9 +++++++++ templates/mayaserver.service.tmpl | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/start_mayaserver.sh b/scripts/start_mayaserver.sh index 132c7424e8..c7631411b3 100644 --- a/scripts/start_mayaserver.sh +++ b/scripts/start_mayaserver.sh @@ -2,11 +2,20 @@ set -e +SELF_IPV4=$1 + +if [ $# -ne "" ]; then + SELF_IP4=127.0.0.1 +fi + echo "Setup Mayaserver Daemon ..." # Place systemd service template for Mayaserver sudo cp /etc/maya.d/templates/mayaserver.service.tmpl /etc/systemd/system/mayaserver.service +# Replace the placeholders with actual values +sudo sed -e "s|__SELF_IPV4__|$SELF_IPV4|g" -i /etc/systemd/system/mayaserver.service + echo "Starting Mayaserver service ..." sudo systemctl enable mayaserver.service diff --git a/templates/mayaserver.service.tmpl b/templates/mayaserver.service.tmpl index e9b3e65598..56ae025a60 100644 --- a/templates/mayaserver.service.tmpl +++ b/templates/mayaserver.service.tmpl @@ -4,7 +4,7 @@ Description=Mayaserver Daemon [Service] Environment=GOMAXPROCS=2 Restart=on-failure -ExecStart=/usr/bin/mayaserver up &>mserver.log +ExecStart=/usr/bin/mayaserver up -bind=__SELF_IPV4__ &>mserver.log ExecReload=/bin/kill -HUP $MAINPID KillSignal=SIGTERM