jack's picture

Is there a default login for the Drupal page (bare ip).  I am able to login to webmin, mysql, phpmyadmin, etc.  with the passwords I provided during applicance setup but cannot request a new Drupal account since my ISP will not accept smtp from my residential address.  Is there an alternate way to set up the Drupal account from either the mgmt web pages or terminal?

Thanks in advance

Forum: 
Jeremy Davis's picture

You can rerun the firstboot script but I am unsure of the consequences of that (there may be a risk to your data - I don't think it will, but not sure). So if you haven't enabled TKLBAM backups already then now is probably a good time to do it (or use some other means to backup all your data).

Then fo to the firstboot script directory, OTTOMH it should be something like this:

cd /usr/lib/inithooks/bin

and ist the contents with:

ls

there should be a script named something like drupal.py. Assuming that is the name, run it like this

./drupal.py

The other alternative is to follow the Drupal documentation on resetting the Admin password.

[edited] Corrected the filesystem location of the inithook scripts - sorry for any issues caused!

Jeremy Davis's picture

Like I posted above, you can just rerun the Drupal init script (rather than the whole thing)

Jeremy Davis's picture

My mistake, I have given you incorrect info. The correct path to the init scripts is:

/usr/lib/inithooks/bin

Not /var/lib/... as I stated above. I apologise for the mistake. I have also edited my post above to reflect the corrent path.

Jeremy Davis's picture

The dollar sign ($) is interpreted by the Linux commandline as announcement of a variable (other than assigning value; anytime you use a variable on the commandline or within a bash script you preface the variable name with $) and $1 is generally taken by the commandline to mean (the first) argument (the second argument or input string will be $2). So if you write a simple bash script that accepts input eg "simple-script blah" the value "blah" will be passed to the script as an argument, within the script you could then refer to $1 and it would equal blah (eg "echo $1" will print blah to the screen. So in this context your code:

drush user-password admin --password=$1gma

is telling drush that you want a password of gma (because $1 will be an empty string in the context of your line of code). To work around this, enclose your password in single quotes (') like this:

drush user-password admin --password='$1gma'

Single quotes tell the commandline to treat everything between them as a single string so it will set a password of $1gma

Note that it must be single quotes ('), not double quotes ("). Double quotes don't have the same effect.

drush user-password admin --password="$1gma"

will still result in a password of gma...

Jeremy Davis's picture

Let me make sure I have this straight.

When entered into the firstboot scripts, the password with $ (eg your example $1gma) works fine for the root account, MySQL, other services you have tried. However when you try to set that as the Drupal password it fails (and in fact sets the password to gma)?

If that's the case, then IMO it's a bug in the TKL init scripts. I think that it's legitimate for it to not work using drush at the commandline (because of the Linux commandline limitations - which are well recognised by Linux admins and only a google away for anyone else - although a note somewhere stating this is not unreasonable). But for the firstboot scripts to not work as intended is a bug in my books...

Where would you suggest that the info about using single quotes for passwords should be displayed? Where would you have looked first? Where might you have seen it?

Jeremy Davis's picture

My first suspicion is that you have corrupted downloads. Have a look in the docs/wiki here for how to check.

Other things to check are keyboard layout (by default the keyboard layout is standard US - it may cause issues depending on the passwords you choose if your layout is different).

The other possibility OTTOMH is that some special characters are not working properly (there was a bug that did that years ago but I'm sure it was fixed - but maybe some special characters not working properly?). 

You can rerun the firstboot scripts again (assuming that you can login into the root account) with 'turnkey-init'.

Jeremy Davis's picture

Your experience is that the init scripts react differently to the same password. Ie you are able to set a root password including '$' but that same password when used for Drupal doesn't error, but doesn't actually use the password you set?

Jeremy Davis's picture

I have lodged a bug.

Add new comment