Preventing network render daemon terminal, OS X
Posted: Fri Feb 15, 2019 8:19 pm
Some of our users accidentally close the Terminal window that runs the Octane network render daemon, causing a sudden loss of network rendering, or finding that their shutdown/reboots have hung because the network render daemon in the console wants confirmation before quitting.
So to avoid having an active Terminal for network Octane, I’ve modified the shell script that launches the daemon, adding the nohup command, preventing a terminal window from launching and sending the daemon output to dev/null. The daemon still runs just fine without a terminal. If you need to kill it manually, just do so in Activity Monitor.
This was written and tested under OS 10.12.6/Octane 4.xx, and has not been tested with other versions of Mac OS or Octane.
This works for us, but I’ve stripped out the code that makes sure things like non-standard characters in path names continue to function, and some other stuff I honestly don't fully understand. One of our real coders told me, "Oh, yeah, that stuff just makes it more bulletproof in weird installs." As long as you’re not doing wacky stuff like using tildes in your paths, or keeping the OctaneRender Daemon.app somewhere it probably shouldn't be, this should work fine.
Disclaimer: I am not a real developer, and have no professional training in writing code. I just fumble my way through the dark until things work more-or-less correctly. So use this at your own risk. This may make the OTOY devs cringe.
To make the OctaneRender Daemon launch and run without a terminal, use the contextual menu item, "Show Package Contents," on the app and replace the contest of
/Applications/OctaneRender Daemon. 4.xx.app/Contents/MacOS/run_slave_daemon.sh, with the plain-text editor of your choice.
Start with this:
and replace with this:
The launchd Launch Agent simply calls the app, so there’s no need to go mucking about in /Library/LaunchAgents or /Library/LaunchDaemons
Note that this will overwrite the settings for port ID and out of core RAM usage that you chose when you first ran the “install daemon” script. Feel free to use whatever port number and out of core RAM is appropriate for your setup.
I hope someone finds this useful. It is certainly saving me a bunch of time responding to help requests.
So to avoid having an active Terminal for network Octane, I’ve modified the shell script that launches the daemon, adding the nohup command, preventing a terminal window from launching and sending the daemon output to dev/null. The daemon still runs just fine without a terminal. If you need to kill it manually, just do so in Activity Monitor.
This was written and tested under OS 10.12.6/Octane 4.xx, and has not been tested with other versions of Mac OS or Octane.
This works for us, but I’ve stripped out the code that makes sure things like non-standard characters in path names continue to function, and some other stuff I honestly don't fully understand. One of our real coders told me, "Oh, yeah, that stuff just makes it more bulletproof in weird installs." As long as you’re not doing wacky stuff like using tildes in your paths, or keeping the OctaneRender Daemon.app somewhere it probably shouldn't be, this should work fine.
Disclaimer: I am not a real developer, and have no professional training in writing code. I just fumble my way through the dark until things work more-or-less correctly. So use this at your own risk. This may make the OTOY devs cringe.
To make the OctaneRender Daemon launch and run without a terminal, use the contextual menu item, "Show Package Contents," on the app and replace the contest of
/Applications/OctaneRender Daemon. 4.xx.app/Contents/MacOS/run_slave_daemon.sh, with the plain-text editor of your choice.
Start with this:
Code: Select all
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
ALIAS=`hostname -s`
osascript << _OSA_END_
tell application "Terminal"
do script "\"$SCRIPT_DIR/octane_slave_daemon\" --slave \"$SCRIPT_DIR/octane_slave\" --alias \"$ALIAS\" --port 48000 --out-of-core 12g; exit"
end tell
_OSA_END_
exit 0Code: Select all
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
ALIAS=`hostname -s`
nohup "$SCRIPT_DIR"/octane_slave_daemon --slave "$SCRIPT_DIR"/octane_slave --alias $ALIAS --port 48000 --out-of-core 12g
exitNote that this will overwrite the settings for port ID and out of core RAM usage that you chose when you first ran the “install daemon” script. Feel free to use whatever port number and out of core RAM is appropriate for your setup.
I hope someone finds this useful. It is certainly saving me a bunch of time responding to help requests.