aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-04-28 03:28:56 +0000
committerLaurent Bercot <ska@appnovation.com>2025-04-28 03:28:56 +0000
commit63ae0841dcc024464290edf9080ce536a1d7905e (patch)
treed93fe732743e54ee4b45528341c12d6a4470d808
parent7dda4a124069438acb19a419a088f5c1ab9b4670 (diff)
downloads6-63ae0841dcc024464290edf9080ce536a1d7905e.tar.gz
Document s6-softlimit -H|-h
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--doc/s6-softlimit.html15
-rw-r--r--package/configure-snippets/configure_extra_checks1
-rw-r--r--src/daemontools-extras/s6-softlimit.c2
-rwxr-xr-xtools/configure.template7
-rwxr-xr-xtools/gen-configure.el1
5 files changed, 23 insertions, 3 deletions
diff --git a/doc/s6-softlimit.html b/doc/s6-softlimit.html
index 7d53248..05701ce 100644
--- a/doc/s6-softlimit.html
+++ b/doc/s6-softlimit.html
@@ -25,7 +25,7 @@ s6-softlimit changes its process limits, then executes into another program.
<h2> Interface </h2>
<pre>
- s6-softlimit [ -a <em>allmem</em> ] [ -c <em>core</em> ] [ -d <em>data</em> ] [ -f <em>fsize</em> ] [ -l <em>lock</em> ] [ -m <em>mem</em> ] [ -o <em>ofiles</em> ] [ -p <em>proc</em> ] [ -r <em>res</em> ] [ -s <em>stack</em> ] [ -t <em>cpusecs</em> ] <em>prog...</em>
+ s6-softlimit [ -H | -h ] [ -a <em>allmem</em> ] [ -c <em>core</em> ] [ -d <em>data</em> ] [ -f <em>fsize</em> ] [ -l <em>lock</em> ] [ -m <em>mem</em> ] [ -o <em>ofiles</em> ] [ -p <em>proc</em> ] [ -r <em>res</em> ] [ -s <em>stack</em> ] [ -t <em>cpusecs</em> ] <em>prog...</em>
</pre>
<ul>
@@ -37,6 +37,19 @@ s6-softlimit changes its process limits, then executes into another program.
<h2> Options </h2>
+<h3> Hard limit options </h3>
+
+<ul>
+ <li> <tt>-H</tt>&nbsp;: set the hard limit (as well as the soft limit). This is only usable by root
+if you're raising the limit, and should generally <em>not</em> be used, except once at boot time.
+The "hard limit" should be a system-wide setting that is never touched after being set once. </li>
+ <li> <tt>-h</tt>&nbsp;: set the hard limit, without touching the soft limit.
+If you're lowering the hard limit to a value that's lower than the current soft limit, it will fail
+and s6-softlimit will die. There is virtually no reason to ever use this. </li>
+</ul>
+
+<h3> Resource selection options </h3>
+
<ul>
<li> <tt>-a&nbsp;<em>allmem</em></tt>&nbsp;: limit the total available memory to <em>allmem</em> bytes. </li>
<li> <tt>-c&nbsp;<em>core</em></tt>&nbsp;: limit the core file size to <em>core</em> bytes. </li>
diff --git a/package/configure-snippets/configure_extra_checks b/package/configure-snippets/configure_extra_checks
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/package/configure-snippets/configure_extra_checks
@@ -0,0 +1 @@
+
diff --git a/src/daemontools-extras/s6-softlimit.c b/src/daemontools-extras/s6-softlimit.c
index b1bf615..d6112b2 100644
--- a/src/daemontools-extras/s6-softlimit.c
+++ b/src/daemontools-extras/s6-softlimit.c
@@ -8,7 +8,7 @@
#include <skalibs/uint64.h>
#include <skalibs/exec.h>
-#define USAGE "s6-softlimit [ -a allbytes ] [ -c corebytes ] [ -d databytes ] [ -f filebytes ] [ -l lockbytes ] [ -m membytes ] [ -o openfiles ] [ -p processes ] [ -r residentbytes ] [ -s stackbytes ] [ -t cpusecs ] prog..."
+#define USAGE "s6-softlimit [ -H | -h ] [ -a allbytes ] [ -c corebytes ] [ -d databytes ] [ -f filebytes ] [ -l lockbytes ] [ -m membytes ] [ -o openfiles ] [ -p processes ] [ -r residentbytes ] [ -s stackbytes ] [ -t cpusecs ] prog..."
static int what = 1 ;
diff --git a/tools/configure.template b/tools/configure.template
index dd449d0..f9faa60 100755
--- a/tools/configure.template
+++ b/tools/configure.template
@@ -240,7 +240,7 @@ done
# Process deps-build
if test -n "$pkgconf" || $pcw || $slashpackage ; then
oldifs="$IFS"
- while IFS=" " read cond usedinlibs pkg ver libs ; do
+ while IFS=" " read cond usedinlibs pkg ver libs ; do
IFS="$oldifs"
eval "cond=$cond; usedinlibs=$usedinlibs"
if $cond ; then
@@ -418,6 +418,8 @@ else
LDFLAGS_NOSHARED="${LDFLAGS_NOSHARED}${addlibdpath}"
fi
+${configure_extra_checks}
+
echo "Creating config.mak..."
cmdline=$(quote "$0")
for i ; do cmdline="$cmdline $(quote "$i")" ; done
@@ -513,12 +515,15 @@ EOF
if $slashpackage ; then
echo "#define ${package_macro_name}_BINPREFIX \"$bindir/\""
echo "#define ${package_macro_name}_EXTBINPREFIX \"$extbinprefix/\""
+ echo "#define ${package_macro_name}_EXTLIBEXECPREFIX \"$extbinprefix/\""
elif $abspath ; then
echo "#define ${package_macro_name}_BINPREFIX \"$bindir/\""
echo "#define ${package_macro_name}_EXTBINPREFIX \"$bindir/\""
+ echo "#define ${package_macro_name}_EXTLIBEXECPREFIX \"$libexecdir/\""
else
echo "#define ${package_macro_name}_BINPREFIX \"\""
echo "#define ${package_macro_name}_EXTBINPREFIX \"\""
+ echo "#define ${package_macro_name}_EXTLIBEXECPREFIX \"$libexecdir/\""
fi
echo "#define ${package_macro_name}_LIBEXECPREFIX \"$libexecdir/\""
${configure_generate_configh}
diff --git a/tools/gen-configure.el b/tools/gen-configure.el
index 2017dc2..577d86f 100755
--- a/tools/gen-configure.el
+++ b/tools/gen-configure.el
@@ -16,6 +16,7 @@ multisubstitute
importas -uS configure_case_lines
importas -uS configure_expand_dirs
importas -uS configure_slashpackage_other
+ importas -uS configure_extra_checks
importas -uS configure_generate_make
importas -uS configure_generate_configh
}