Skip to content
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

Closed
tvwerkhoven opened this issue Nov 10, 2018 · 6 comments
Closed

Install script does not chown data to current user #2858

tvwerkhoven opened this issue Nov 10, 2018 · 6 comments

Comments

@tvwerkhoven
Copy link

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
Copy link
Contributor

gizmocuz commented Nov 11, 2018

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

@tvwerkhoven
Copy link
Author

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

@gizmocuz
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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 ?

@gizmocuz
Copy link
Contributor

gizmocuz commented Jan 1, 2019

No response, closing issue

@gizmocuz gizmocuz closed this as completed Jan 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants