ether / pad

Etherpad Open-Source Repository
http://github.com/ether/pad
Other
1.03k stars 184 forks source link

etherpad/bin/run-local.sh script dependant on exact order of parameters #302

Closed AlainKnaff closed 10 years ago

AlainKnaff commented 12 years ago

When etherpad is started, /etc/init.d/etherpad first calls /usr/share/etherpad/bin/run.sh with the equivalent of the following command line:

/usr/share/etherpad/bin/run.sh $"DAEMON_ARGS"

bin/run.sh then calls etherpad/bin/run-local.sh using the following command line:

exec bin/run-local.sh --etherpad.soffice="$SOFFICE_BIN" "$@" 256M

However, run-local.sh expects its parameters in a well-defined order, where --cfg (if present) must precede --etherpad.soffice . This makes it impossible to put --cfg into DAEMON_ARGS (needed if I want to start up several instances).

Changing the last line of bin/run.sh into the following works around the issue:

exec bin/run-local.sh "$@" --etherpad.soffice="$SOFFICE_BIN" 256M

however, this would probably break on any options that are supposed to come after etherpad.soffice.

A better solution would be if run-local.sh didn't depend on the order of options:

while [ $# -gt 0 ] ; do case $1 in --etherpad.soffice)

do etherpad.soffice stuff with $2

    shift
    shift
    ;;
--cfg)
     # do cfg stuff with $2
     shift
     shift
     ;;
     ...
*)
    break
    ;;
esac

done

JohnMcLear commented 12 years ago

It would be nice if you could issue a pull request with this implemented, thanks! :)

AlainKnaff commented 12 years ago

I'm not yet knowledgeable about git; how can I do this?

After further analysis, it turned out that the --etherpad.soffice option is not actually used by run-local.sh , so maybe run.sh should also be changed not to include it...

JohnMcLear commented 12 years ago

http://help.github.com/pull-requests/

-----Original Message----- From: AlainKnaff [mailto:reply@reply.github.com] Sent: 12 November 2011 18:59 To: John McLear Subject: Re: [pad] etherpad/bin/run-local.sh script dependant on exact order of parameters (#302)

I'm not yet knowledgeable about git; how can I do this?

After further analysis, it turned out that the --etherpad.soffice option is not actually used by run-local.sh , so maybe run.sh should also be changed not to include it...


Reply to this email directly or view it on GitHub: https://github.com/ether/pad/issues/302#issuecomment-2718822 This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of the organisation from which this email originated. If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone. Please contact the sender if you believe you have received this email in error. This email was sent by School Email - Safe Webmail and Hosted Email for Schools;/p>

AlainKnaff commented 12 years ago

Done. I hope I did everything right...