New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install script does not chown data to current user #2858

Open
tvwerkhoven opened this Issue Nov 10, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@tvwerkhoven

tvwerkhoven commented Nov 10, 2018

The install script (from install.domoticz.com) does not chown files to the current user, and instead inherits file permissions from the release file. The fix is simple:

--- install_domoticz.sh	2017-09-09 14:11:41.000000000 +0200
+++ install_domoticz_fixed.sh	2018-11-10 14:28:49.607054107 +0100
@@ -367,6 +367,7 @@
 	echo "::: Unpacking Domoticz..."
 	tar xvfz domoticz_release.tgz
 	rm domoticz_release.tgz
+	chown --recursive "${Current_user}":"${Current_user}" *
 	Database_file="${Dest_folder}/domoticz.db"
 	if [ ! -f $Database_file ]; then
 		echo "Creating database..."
@gizmocuz

This comment has been minimized.

Contributor

gizmocuz commented Nov 11, 2018

no issues here... all is owned by the 'pi' user...

@tvwerkhoven

This comment has been minimized.

tvwerkhoven commented Nov 11, 2018

Yes, that's the issue, the script only works for user 'pi', not any other user (e.g. domoticz). This chown fixes that :)

@gizmocuz

This comment has been minimized.

Contributor

gizmocuz commented Nov 16, 2018

hmmm why is this happening ? there is no reference for the pi user in the install script at all ?
It should for any user that has sudo rights

@tvwerkhoven

This comment has been minimized.

tvwerkhoven commented Nov 17, 2018

I think it’s because the files are owned by user pi inside the tar.gz file and the permissions are retained when unpacking. Can that be?

@gizmocuz

This comment has been minimized.

Contributor

gizmocuz commented Nov 18, 2018

That could very well be the case... maybe it needs to be unpacked differently, but from my understanding this only happens when the 'user' exists on the system. Does the pi user exists on your system? If yes, why not use it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment