I have noticed most Drush posts seem to be in issues rather than the forums, so I am giving this a shot: I have a managed CentOS 5 VPS, want drush for multisite and multiple accounts. The ideal location would be usr/local/drush which is above my root ssh login folder. That way I only have a single Drush installation to maintain rather than, say, maintaining 3 or 4 Drush installations. But I get "No such file or directory" - regardless of creating the alias and/or the symlink. Regarding the readme:

1 - Untar the tarball into a folder outside of your web site: Does that mean any folder? If I have multiple accounts with multisite users on each account, can I use a system-level folder so that all instances of Drupal can be maintained by a single Drush install? Or does the folder have to be a sub-folder of the root directory that my SSH sessions open into?

2 - create a link to drush in a directory that is in your $PATH: just what exactly does that mean? The link creation I get, but just what folder am I to create the symlink in? The root for the account? The home directory for html? Neither solves the problem for me.

3 - create alias in .profile, .bash_aliases or .bashrc ? Should one go into .bash_profile as well? How about etc/bashrc ? (no dot in front of the name) I have seen at least one post where that was what finally enabled Drush for that poster.

Any clarification will be greatly appreciated.

Comments

greg.1.anderson’s picture

Status: Active » Fixed

From bash:

echo $PATH

This will list a bunch of directories that are searched when you execute commands. /bin, /usr/bin and /usr/local/bin are commonly included, but different systems will include different directories by default.

Then become root. If you don't already have a /usr/local folder:

mkdir -p /usr/local

Put drush there. You can put it anywhere, really. Then make a symbolic link, e.g.

ln -s /usr/local/drush/drush /usr/local/bin/drush

Customize that last one depending on what's in your $PATH. You can customize your path; google it if you want to do that.

wb54321’s picture

Thanks Greg. In the meantime I kept at the issue and finally got Drush running. My VPS hosting provider (Knownhost) suggested the usr/local/drush folder to install Drush into. I followed the Readme instructions, adding "alias drush='/usr/local/drush/drush'" to .bashrc - nothing. I used Dreamweaver CS5, Notepad++, and finally Pico to edit the darn thing; still no results.

Finally Knownhost support suggested using this to edit .bashrc:

# echo "alias drush='/usr/local/drush/drush'" >> ~/.bashrc

Like magic, everything started working! Curious, I downloaded the .bashrc to compare it with the version I edited locally: they are identical. I use Filezilla in SFTP mode to move files back and forth. I don't know if the problem was Filezilla, CentOS, or what. Editing via the command line using Pico (nano) should be a legitimate way to edit .bashrc and have it run properly afterward, but in this case it clearly was not. A hard lesson learned.

Probably devoted 20 hours to getting Drush to run, but I feel it is worth it. In the long run, I can use Drush to maintain every Drupal install on the server while having only one Drush installation to maintain. Hope this helps out someone else on Knownhost CentOS in the future.

greg.1.anderson’s picture

The problem with editing a bash script or bashrc file on another computer & file-transferring it over is that sometimes your editor will insert CR LF at the end of every line, whereas Linux expects to see only CR. More than once I have hit my head against the wall because I had a script that started #!/bin/bash[CR], I could not see the CR, and I could not figure out why the shell was telling me that it could not find /bin/bash, when /bin/bash clearly existed and was executable!

Even when you know about this gotcha, it can still bite you.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

FranCarstens’s picture

Bookmarking. This solution worked for me on Knownhost, using WHM.

My alias file included the following:

$aliases['live'] = array(
		'uri' => 'domain',
		'root' => '/home/user/domain',
		'remote-host' => 'IP Address',
		'os' => 'Linux',
		'remote-user' => 'root',
		'ssh-options' => '-p YOUR SSH PORT',
		'path-aliases' => array(
			'%drush' => '/usr/local/drush',
			'%drush-script' => '/usr/local/drush/drush',
),