CentOS 7 - Domain Server Compile and Update Script


#21

It should auto pick what to install as dependancies automatically as I have tested it with the base CentOS 7 install, AWS CentOS and the CentOS on Digital Ocean. All worked there with no issues but if you want to send me a private message with more info on your install so I can find what might have been different I can see. Thanks!

(This includes a link to any custom images you installed from so I can be prepared for those too.)


#22

It has me baffled too, when i initially tested it on a Virtual Machine running Cent OS 7 on my laptop, the script ran and worked flawlessly as expected, i tried the script again a few days later on the test server hosted in Germany (im in the UK), and yum it failed to satisfy dependancies (the logs of the output i posted in this thread earlier) and so the entire yum command containing all the stuff required by the script was skipped by yum, because Qt and openssl were not available, so the rest of the script’s routines were doomed to fail because everything was essentially missing. (including wget initially)

Edit: i’m 90% sure this problem is within the CentOS Repo/Mirrors and not your script, however since it does not detect any exit status (that i could tell) from the Yum commands, it will assume successful exit even if the exit from yum contained errors or did not succeed.


#23

I’ve only just now finally gotten enough of the day-job-build-day BS (2nd day, 3rd attempt, oy) out of the way to start trying this. Stuff was scrolling by as I switched windows to here. But I gotta say, this is like a Chef recipe, only more MacGyver-badass.


#24

Go here, look for the bits lower down that Coal wrote:
https://alphas.highfidelity.io/t/how-to-compile-hifi-in-centos-7-x-domain-server-and-assignment-client/1109/38?u=sterlingwright

(although that is probably not as much fun! In this instance, however, I choose ease…)


#25

Im using the compile and running scripts too. With many things help me Coal in a private message. This things I want make avaible now, with its togetherness.

  • my server running at a droplet of digitalocean with a contract to 5$/Month
  • update your code with the command: compilehifi
  • I use the server vsftpd, and can so upload FBX-Files to my own server (anonymous read rights are usefully)
  • Do not forget setting your server IP at the Hifi-Directory under the point domain.
  • Use the command sudo, a firewall and the secure shell at your server! Without this you can see very much login tryings to you server.



But I have a problem. How can hifi run automatically at the systemstart? I tried this with the systemd.

  1. I created a Hifi service in the file /lib/systemd/system/hifi.service. The alias are unkown for the systemd, also I use the original command.

“############################################################”
"#"
"# hifi.service"
"# systemd service: run hifi at start"
"#"
"############################################################"

[Unit]
Description=Run Hifi

[Service]
Type=idle
ExecStart=/usr/bin/bash -c “/usr/bin/bash <(/usr/bin/curl -Ls https://raw.githubusercontent.com/nbq/hifi-compile-scripts/master/centos7-run-hifi.sh)”

[Install]
WantedBy=multi-user.target

“# EOF”

  1. I activated and started the service.
    systemctl enable hifi.service
    systemctl start hifi.service
    –> The domain-server is running.

  2. Reboot. --> The domain-server is not running.

  3. “systemctl status hifi.service” and I get the following message:

hifi.service - Run Hifi
  Loaded: loaded (/usr/lib/systemd/system/hifi.service; enabled)
  Active: inactive (dead) since Wed 2015-04-15 18:53:40 CEST; 50s ago
  Process: 2142 ExecStart=/usr/bin/bash -c /usr/bin/bash <(/usr/bin/curl -Ls https://raw.githubusercontent.com/nbq/hifi-compile-scripts/master/centos7-run-hifi.sh) (code=exited, status=0/SUCCESS)

Apr 15 18:53:39 hifisim systemd[1]: Starting Run Hifi…
Apr 15 18:53:39 hifisim su[2149]: (to hifi) root on none
Apr 15 18:53:40 hifisim systemd[1]: Started Run Hifi

The command ps -All do not show the domain and the assignment server. What ist the problem? Did I forget any dependencies?

Ciao!
Juels


#26

Hey Juels!

Flagging with @JuelsDreki

I will make a service script compatible one in the next few days but for right now the way it shells off into user ‘hifi’ is done in a way that will not work in a service script.

I will update the post when I am done with the service run script.

Thanks for all of your work so far Juels!


#27

Gladly Coal.

Ok, then I am waiting for your script. :slight_smile:


#28

@Coal if you (or anyone else) is/are interested, i’ve made a cron friendly version of your script, which is a watered down and tweaked version of it with some additional logging and error handling, so it can be safely run by cron (in theory) without negatively affecting the currently running instance should the compile fail for any reason. i have not tested this yet (at time of posting) and im still sipping my morning coffee and glaring over it for anything i’ve missed, if anyone has any suggestions, i’d welcome that, also coal if you see anything useful in there that might be handy for your script, feel free to use them.


#29

Thanks but the only real difference is you do check for if the command to make domain-server and assignment-client failed and logs that.

You also have the “killrunning” function declared twice.

If it works with cron to spin off under user hifi then I will be happy since its one part I have not tested outside of manual running but should work fine under crond.

Also for the cron I would have used recompile since it checked with git pull if a compile was actually needed.


#30

Yes, you are quite right, i have added a failsafe exit in case the compile command fails. with unattended updates the last thing we want is for the other commands to run and copy over a potentially broken compile and run (or fail to) it. that may also be useful for the manual run case as well, since the current script might make a mess of things if the build does fail for some reason. it would be cleaner for the script to halt at the point of failure so the user can analyse and correct any issues.

Thanks for pointing that out, totally skimmed over it, have since removed the duplicate.


#31

just to update you, under cron it seems to launch under the hifi user just fine.


#32

That will come in very handy @Ronnie thanks for the value add. Quick question, does the cron job ensure the service is back up and running after update and are logs showing an update occurred with results somewhere so we can check from time to time? The log should be a short one line or two with date of update, version, and outcome.

Then I could get my server monitors to watch that log for all servers for a centralized maintenance status webpage.

Thanks for the considerations… @VR_Architect


#33

Currently no, it does not copy the previous build as a .bak or .old folder before moving in the new files, though this is relatively easy to do… in it’s current state, the script will exit if the build fails, with time stamps and full build output saved to a log file for debugging, or for personal curiosity if you want to see how it’s running.

i made a thread for it Here


#34

Can I save and reload the domain content, if I want recompile the doamin server? Or is there another way to get the domain content?


#35

A recompile does not overwrite your data with my script, nothing under resources is touched. That is where your domain contents are stored.


#36

Hmm, the directory /usr/local/hifi/run/ressources is not empty after a recompile, but the content are not showed. The same after a restart of the domain server with the webinterface. I saw the bounding box of my skybox, but after the entry into the edit mode, the skybox was missing.

my skybox is a mesh cube with the position 4192,4192,4192 and dimensions of 16384,16384,16384.


#37

the file that stores your actual domains data is models.svo


#38

It could be a bug I’ve been reluctant to talk about until I could document its behavior, but, I’ve seen with very large objects (which yours certainly is) a habit of it being there one moment - then click edit and it’s gone. A secondary manifestation of this is selecting multiple objects - moving them then watching them disappear never to be seen again.

So far I’ve found no way to reliably reproduce either issue or explanation for.


#39

Ok, I moved the server. In the file models.svo is included a skybox with a wrong URL, but this sky was not seen before too. How can I remove this sky?


#40

If you can see it in models list from edit.js - you should be able to delete. If it is the only thing in models.svo you could stop stack servers, delete models.svo and restart to begin with an empty domain space.