https://bugs.contribs.org/show_bug.cgi?id=10494
--- Comment #22 from Jean-Philippe Pialasse <[email protected]> ---
(In reply to John Crisp from comment #21)
> Setting the path works.
>
> The one issue is setting the script to start the server as user teamspeak so
> it can be run from init with
>
> service teamspeak start
>
> The old TS2 init script started it with su like this:
>
> su $USER -c "$DIR/server_linux -PID=tsserver2.pid"
>
> But the newer script is more complicated and checks for root at the start
> and then executes the server like this:
>
> export LD_LIBRARY_PATH="${LIBRARYPATH}:${LD_LIBRARY_PATH}"
>
> "./${BINARYNAME}" ${COMMANDLINE_PARAMETERS} > /dev/null &
> PID=$!
> ps -p ${PID} > /dev/null 2>&1
>
> I believe there may be a way to set the UID and GID in the script file
> something like this:
>
> http://thedjbway.b0llix.net/daemontools/uidgid.html
>
> Any suggestions ?
well this could be an idea to move this to a supervised service using
deamontools like httpd or mysql....
or basically you could just adapt the old initscript from the new sh script and
use exec and env to set user and group as done in a deamontools run script
UID=`id -u teamspeak 2>/dev/null`
GID=`id -g teamspeak 2>/dev/null`
exec env UID=${UID} GID=${GID} \
export LD_LIBRARY_PATH="${LIBRARYPATH}:${LD_LIBRARY_PATH}" \
"./${BINARYNAME}" ${COMMANDLINE_PARAMETERS} > /dev/null & PID=$!
or something like that should do the trick
--
You are receiving this mail because:
You are the QA Contact for the bug._______________________________________________
Mail for each SME Contribs bug report
To unsubscribe, e-mail [email protected]
Searchable archive at https://lists.contribs.org/mailman/public/contribteam/