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

Add the path to shiny-server binary and add explanation #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vzemlys
Copy link
Contributor

@vzemlys vzemlys commented Jun 28, 2013

For some reason if the shiny-server is not referenced by the full path , the start-stop-daemon does not start it.

For some reason if the shiny-server is not referenced by the full path , the start-stop-daemon does not start it.
@antoine-lizee
Copy link

It could read DAEMON=which shiny-server`` too. More flexible I guess.
I second this pull request! We are these two lines short to make the init.d script work.

DESC="shiny server"
NAME=shiny-server
DAEMON=shiny-server
DAEMON=/usr/local/bin/shiny-server

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DAEMON=which shiny-server`` may be preferable.

@jimklo
Copy link

jimklo commented Apr 17, 2015

I know that this is old, but thought I'd still comment, as the suggestion is a misunderstanding of how the which command works. @antoine-lizee actually that wouldn't be any better than just inserting shiny-server. which just returns the absolute path of the first item found on the PATH, as it's possible one might have several versions installed in different locations. It would still require the the path to the right shiny-server to be on the PATH before all others. If it's not on the PATH, which won't find it.

TLDR;
Just use an absolute path as the pull request suggests.

@antoine-lizee
Copy link

Hi @jimklo,

Thank you for trying to teach me that, but I know what which does :-). The only misunderstanding might be about the problem at stake. I had only one version of shiny server installed, but for whatever reason (it's old, as you say it...) using DAEMON=shiny-server instead of some kind of DAEMON=/path/to/shiny-server didn't work on my machine. It's not about having several versions and all, just about the script failing if you just give the command name, and this is solved with which. I might miss something though!

@jimklo
Copy link

jimklo commented Apr 22, 2015

I know your problem has nothing to do with multiple versions, and it could be just the way your system is behaving. According to the man page for 'which', it just searched the PATH environment variable and returns the absolute path of the first one it find. What I'm saying is something is odd about your system if 'which' finds the program, but the shell you're executing 'which' cannot. They should be using the same PATH environment variable to resolve. Hence why I question using 'which' - I'm not denying it works for you, but I'd like to know why it works, because the way you describe the problem - 'which' should not work either, unless your sub-shell's environment is different from the main shell's.

If you can do:

'''PATH= which shiny-server'''

And this returns a path - something is really odd.

@antoine-lizee
Copy link

Yeah, the problem comes from the fact, as specified by the OP, that if the name of the daemon only is provided, the script will not execute properly - should it be on the path or not! It is because of the following line:

[ -x "$DAEMON" ] || exit 0

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

Successfully merging this pull request may close these issues.

3 participants