Install hifi from the linux packages


#1

@seth
@leviathan

Hello seth and leviathan,

according to a hint from ZappoMan I tag you both.

I install Hifi at my virtual Linux server according to this guide:
https://github.com/highfidelity/hifi/blob/master/BUILD_LINUX_CHEATSHEET.md

That is not a problem, Hifi works well. But the directory “.local/share/High Fidelity” be created directly under “/” and not in “/home/hifi”. Is that correct? How can I install it in this way, that the folder ./local/… be created in the folder /home/hifi?


#2

I believe that directory is chosen by Qt with QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)
Maybe there’s a clue somewhere in http://doc.qt.io/qt-5/qstandardpaths.html ?


#3

Hello sethalves,

that is possible, but in the time in which I install Hifi from the package, is it to late to edit the source code. I am not the developer. :wink:

I think the problem is, that the domain- and asset server are started directly after the installation, and in this way I can not change the user, before the servers are started after the installation.


#4

Looking at the online documentation for QStandardPaths::AppDataLocation… on linux it translates to: "~/.local/share/<APPNAME>", "/usr/local/share/<APPNAME>", "/usr/share/<APPNAME>", which means your root user’s $HOME is configured to be /.

I can see a few ways to fix this:

(1) Configure the hifi systemd service to use a specific USER and GROUP. This page may be helpful, but in short you would modify the file /lib/systemd/system/hifi-domain-server.service by adding some lines in the [Service] section:

[User]=yourName
[Group]=yourGroup

(2) Download the code, compile with USER, and run manually.


#5

@leviathan
thank you very much, with your answer I could solve my problem.


#6

@leviathan

Hello leviathan,

After your suggestion I has set
[User]=root
[Group]=root
in the [Service] section. In this way the directory ~/.local/share/highfidelity was created in the root home directory: /root/.local/share/highfidelity

Sorry, but that was not the finally solution. The problem is, the settings are overwritten, if you execute an update/upgrade. Now I want like, that the variable $HOME be used as start directory.

The environment variable $HOME of the user root is set to “/root”. Nevertheless the directory /.local/share/highfidelity be created and not “/root/.local/share/highfidelity”.

Do you have an idea?


#7

@JulesDreki, you’re saying on subsequent updates the highfidelity packages overwrite the [User] and [Group] modifications you made to /lib/systemd/system/hifi-domain-server.service ?

If so, then I do have one idea. I believe systemd is not actually looking for that hifi-domain-server.service file in /lib/systemd/system/. What it really does is look in /etc/systemd/service/ and it happens to find a symbolic link back to the package-file in /lib/systemd/system/. So what you should do is delete the symlink, make a real copy of the file in /etc/ and then manually edit THAT file to have the correct user/group.

I would expect future package updates to overwrite the file in /lib/systemd/system/ but not the one in /etc/systemd/system/.


#8

@leviathan
Thank you, for your answer!

You were right with the symbolic link. There were 2 symbolic links.
/etc/systemd/system/multi-user.target.wants/@hifi-domain-server.service
/etc/systemd/system/multi-user.target.wants/@hifi-assignment-client.service

According to your suggestion I deleted the symbolic links, and created copies from the original files from “/lib/systemd/system” into “/etc/systemd/system/multi-user.target.wants”. In this way the directory “.local/share/highfidelity” was created at the wrong place “/”. Also I put the copied files into “/etc/systemd/system”. But with the real configuration files in this place the system daemon are not started the domain-server and the assignment-client.

My Solution first step :
I put the copied files into “/etc/systemd/system”.
/etc/systemd/system/hifi-domain-server.service
/etc/systemd/system/hifi-assignment-client.service

My Solution second step:
I created again the symbolic links at the original place, but now from the new file copies.
/etc/systemd/system/multi-user.target.wants/@hifi-domain-server.service
/etc/systemd/system/multi-user.target.wants/@hifi-assignment-client.service

In this way the directory “.local/share/highfidelity” was created in the right place as:
/root/.local/share/highfidelity"
And the configuration files in the /etc directory were not overwritten with an update.

Ok, this is sure a solution, but I think there be a better way. It is possible, that you insert the defines for User and Group into the configuration files in your repository/source code? Also:
User=root
Group=root
into the original files
/lib/systemd/system/hifi-domain-server.service
/lib/systemd/system/hifi-assignment-client.service

PS: Sorry I forgot it. The copied files included the defines:
User=root
Group=root
in the [Service] section.