- Add dads section on writing wrapper scripts

PR:		docs/92342
Submitted by:	jylefort
This commit is contained in:
Pav Lucistnik 2006-02-23 13:42:56 +00:00
parent 5c679bd103
commit 49c915c806
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=27222

View file

@ -9219,6 +9219,25 @@ post-install:
for their files.</para>
</sect1>
<sect1 id="dads-sh-exec">
<title>Use the <function>exec</function> statement in wrapper scripts</title>
<para>If the port installs a shell script whose purpose is to launch
another program, and if launching that program is the last action
performed by the script, make sure to launch the program using
the <function>exec</function> statement, for instance:</para>
<programlisting>#!/bin/sh
exec %%LOCALBASE%%/bin/java -jar %%DATADIR%%/foo.jar "$@"</programlisting>
<para>The <function>exec</function> statement replaces the shell
process with the specified program. If <function>exec</function>
is omitted, the shell process remains in memory while the
program is executing, and needlessly consumes system
resources.</para>
</sect1>
<sect1 id="dads-uid-and-gids">
<title>UIDs and GIDs</title>