As this has been confirmed by @ZappoMan - I renamed the title and set this text here to explain this is as intended
Synopsis: If the assignment-client binary is executed from another directory, it does not correctly load models.svo or backup models.svo as expected. Details Below
This is a bit long and technical so I hope it makes sense to those who it may help. On a side note if this were anything other than a test droplet (DigitalOcean) I would NOT be running it as root.
I moved binaries I compiled to their own special build location, lets say $home/hifi/run -
- $home/hifi/run/assignment-client (binary)
- $home/hifi/run/domain-server (binary)
- $home/hifi/run/resources (folder)
- $home/hifi/logs (folder used to store log outputs)
- $home/hifi/run-hifi.sh (shell script)
- $home/hifi/stop-hifi.sh (shell script)
Now you will see that run-hifi.sh is a directory below the binary directories (and the resources directory)
The shell script run-hifi.sh USED to contain this code:
#!/bin/bash # Kills any already running services killall -9 assignment-client > /dev/null 2>&1 killall -9 domain-server > /dev/null 2>&1 # Command to run and background each service # Start Domain Server First /root/hifi/run/domain-server > /root/hifi/domain.log 2>&1 & # Start Assignment-Client Second /root/hifi/run/assignment-client -n 4 > /root/hifi/assignment.log 2>&1 &
The problem was that the logs kept showing errors about backing up and if I placed an entity then shutdown and restarted the servers, nothing would load back because it never got saved.
After doing a bit of digging I figured out what was happening is that the assignment-client expects there to be a resources folder in the directory you are in (pwd or present working directory), not its directory like you would expect (this is where it is a potential bug).
I learned I had to do a pushd (tells the shell script to set the directory you give it as your running directory), then run the servers, then do a popd (kills the pushd directory reference).
Now that I had the directory expectations worked out I modified my shell script to be this:
#!/bin/bash # Set directory as our "running directory" pushd /root/hifi/run/ > /dev/null 2>&1 # Kills any already running services killall -9 assignment-client > /dev/null 2>&1 killall -9 domain-server > /dev/null 2>&1 # Command to run and background each service # Start Domain Server First /root/hifi/run/domain-server > /root/hifi/logs/domain.log 2>&1 & # Start Assignment-Client Second /root/hifi/run/assignment-client -n 4 > /root/hifi/logs/assignment.log 2>&1 & # unset pushd popd > /dev/null 2>&1
Good new is now it loads models.svo correctly on load-up and stores backups
edited to fix the path from the original shell script, it was using my old directory structure, which I copied and pasted as the wrong “original” but the one now is correct as its all under /root/hifi/run/ now