tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: RUN_PRECMD hook



* On 2026-04-12 at 21:02 BST, Roland Illig wrote:

If you go this route of allowing arbitrary commands, I'd prefer to name
the variable RUN_PRECMDS, so that it can be used like this:

#RUN_PRECMDS+=	echo cmd;
#RUN_PRECMDS+=	ulimit -S -t 3600;

This way, it is possible to quickly enable or disable commands as needed.

I don't like this, it feels confusing to require the user to ensure there is a trailing semicolon for what will almost certainly be a single assignment, makes it more likely to cause hard to diagnose failures, and is different to all other *_CMD options we provide for mk.conf.

Any better ideas?  Would a more specific LIMIT_RESOURCES feature that is
analogous to UNLIMIT_RESOURCES be more appropriate, or just too complex?

As long as you need only the ulimit case, I prefer to have a more
specific API that only allows ulimit changes. That way, its purpose will
be clear even five years later.

I guess the simplest way to do this would be for it to just be called ULIMIT_PRECMD or something.

--
Jonathan Perkin                    pkgsrc.smartos.org
Open Source Complete Cloud   www.tritondatacenter.com


Home | Main Index | Thread Index | Old Index