tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
571 stars 99 forks source link

collins.sh script poor use of * regex causes errors in starting collins #364

Open mr-ransel opened 9 years ago

mr-ransel commented 9 years ago

When starting the collins service, if there is more than one item matching the regex $APP_HOME/lib/$APP_NAME* then bash will throw the following error:

/etc/init.d/collins: line 121: [: {$APP_HOME}/lib/{OTHER_FILE_NAME}: binary operator expected

because multiple, space-delimited file paths have been written in the expansion of the above file path. I would submit a pull request to fix it, but I'm not sure what the correct/expected behavior for this should be.

byxorna commented 9 years ago

@rsansel what version of collins are you using? Building from master, or a release?

When compiling by hand or using a release package, the script works as expected for me. There should only be 1 jar named lib/collins*. What are the other files that are matching that pattern for you? Can you try a clean build and see if that solves it for you?

byxorna commented 8 years ago

@rsansel is this still an issue?

mr-ransel commented 7 years ago

Sorry about the anciently slow turnaround. I personally implemented a workaround by just editing it myself, but in my case, the problem was that both these two files exist in that directory: /usr/local/collins/lib/collins.collins-2.0-SNAPSHOT-assets.jar /usr/local/collins/lib/collins.collins-2.0-SNAPSHOT.jar

Presumably the 30 second fix here is to adjust that line to read:

if [ ! -r $APP_HOME/lib/$APP_NAME*SNAPSHOT.jar ]; then

But, again, I don't know that this is actually what the intended behavior here is.