Page 1 of 1

CLOSED: Mount Shares Locally - question on some syntax

Posted: Tue Sep 05, 2017 11:11 am
by kaidukhanne
Under the configuration section are some modifications to /etc/init.d/mount_shares_locally script

1. Replace "***set this string to your username!***" (line 12) with your username. For example "amahi"
- Should that be:
username="amahi"; including the semicolon, quotes and no spaces or username=amahi or username = amahi


2. Change hda (line 25) to the appropriate password:
mysql -u root -phda -e "select name from shares" hda_production | grep -v "^name$" | xargs -d "\n" mkdir -p

- from the template:
mysql -u amahihda -hda -e "select name from shares" hda_production | grep -v "^name$" | xargs -d "\n" mkdir -p

- so, should we change amahihda? to "root:" I'm guessing that's the user or maybe it should be our 1st user or maybe our 1st user password?
- should we change "-hda" to "-phda?" or is that the password we're supposed to change?


I'm just not quite sure what I need to do or not-do.

Thanks,
Craig aka Kaidukhanne

Re: Mount Shares Locally - question on some syntax

Posted: Tue Sep 05, 2017 12:12 pm
by bigfoot65
username="amahi"; including the semicolon, quotes and no spaces or username=amahi or username = amahi
You should replace ***set this string to your username!*** with your first admin user.
- so, should we change amahihda? to "root:" I'm guessing that's the user or maybe it should be our 1st user or maybe our 1st user password?
- should we change "-hda" to "-phda?" or is that the password we're supposed to change?
The guidance says:
The script may require the MariaDB root password be changed:
a. Please see Database Root Password for the appropriate login password.
b. Also if you changed the MariaDB root password on your own.
Item a refers you to a page that reflects the password is hda unless you installed #Amahi between June 16 to June 19, 2017. Item b does not apply unless you changed the password. So if neither a nor b apply, then don't change the password in line 25.

The only thing you should need to change is the username.

I thought the guidance was pretty clear, but I guess not. If you have any suggestions to make it clearer, please let me know. I will be happy to update the wiki.

Re: Mount Shares Locally - question on some syntax

Posted: Tue Sep 05, 2017 5:14 pm
by kaidukhanne
You should replace ***set this string to your username!*** with your first admin user.
Not really my question. My question is about syntax... do I include the quotes, do I remove the semicolon, does it matter if there are spaces, should there be spaces?

Second
mysql -u amahihda -hda -e "select name from shares" hda_production | grep -v "^name$" | xargs -d "\n" mkdir -p
The guidance talks about changing the password, but doesn't say where the password is to be put in the above line.
I think maybe the line should read -p [mariadbpass] but the -u should be what? MariaDB? root? amahihda? My file didn't match the guidance given.

If it's just me and I just messed up the default file (which would explain why it isn't matching the guidance), could I get a copy of the proper file
Do you have an example of a properly formatted script maybe? That would help me at least. Maybe others don't need as much.

Re: Mount Shares Locally - question on some syntax

Posted: Tue Sep 05, 2017 5:59 pm
by bigfoot65
My question is about syntax... do I include the quotes, do I remove the semicolon, does it matter if there are spaces, should there be spaces?
Follow the guidance. Don't read into it. Just replace that string with your user name. It does not say anything about removing quotes or the semicolon.
The guidance talks about changing the password, but doesn't say where the password is to be put in the above line.
Yes it does. It clearly states to replace hda with the appropriate password. There is only one occurrence of hda in that line.
f it's just me and I just messed up the default file (which would explain why it isn't matching the guidance), could I get a copy of the proper file
You can download the default file from the link on the wiki page.

BTW, this is something for advanced users. We strongly discourage users without Linux experience from doing advanced tasks.

It will work if you just put your user name in the file and change nothing else.

Re: Mount Shares Locally - question on some syntax

Posted: Wed Sep 06, 2017 7:35 am
by kaidukhanne
Hello,
Thanks for the replies.
Got it on the first part with the username.

The second part though there was a small difference (after I re-copied the mount_shares_locally script from /usr/share/hda-ctl)
The guidance says this:
mysql -u root -phda -e "select name from shares" hda_production | grep -v "^name$" | xargs -d "\n" mkdir -p

it works, as you suggested, but that's 2 changes, not just the password from the file in /usr/share/hda-ctl which is:
mysql -u amahihda -pAmahiHDARulez -e "select name from shares" hda_production | grep -v "^name$" | xargs -d "\n" mkdir -p

Sincerely,
Craig aka Kaidukhanne

Re: Mount Shares Locally - question on some syntax

Posted: Wed Sep 06, 2017 8:34 am
by bigfoot65
it works, as you suggested, but that's 2 changes, not just the password from the file in /usr/share/hda-ctl which is:
mysql -u amahihda -pAmahiHDARulez -e "select name from shares" hda_production | grep -v "^name$" | xargs -d "\n" mkdir -p
That is not correct. There is nothing in the guidance that states to check /usr/share/hda-ctl. The only passwords that need to be used for this script come from the database root password page. Follow the guidance!

You are making this more complicated than necessary. Only change the username unless you had installed #Amahi between 16 and 19 June 2017. If that condition does not apply, there is no need to change the password. It clearly states the password is hda as reflected in the guidance.

We have not had anyone report issues in the past, so presumably the guidance is sufficient.

BTW since you have this working, I will mark this thread closed.