On 11/22/19 at 04:27am, onitsuka.shinic(a)fujitsu.com wrote:
> > -----Original Message-----
> > From: Dave Young [mailto:dyoung@redhat.com]
> > Sent: Wednesday, November 13, 2019 6:44 PM
> > To: Onitsuka, Shinichi/鬼束 伸一 <onitsuka.shinic(a)fujitsu.com>
> > Cc: kexec(a)lists.fedoraproject.org
> > Subject: Re: [PATCH 1/3] dracut-kdump.sh: Execute the binary and script files in /etc/kdump/{pre.d,post.d}.
> >
> > On 11/06/19 at 04:25am, onitsuka.shinic(a)fujitsu.com wrote:
> > > This patch executes the binary and script files in /etc/kdump/{pre.d,post.d}
> > > just like kdump_pre or kdump_post directive written in /etc/kdump.conf.
> > >
> > > Signed-off-by: shin-onitsuka <onitsuka.shinic(a)fujitsu.com>
> > >
> > > ---
> > > dracut-kdump.sh | 36 ++++++++++++++++++++++++++++++++++++
> > > 1 file changed, 36 insertions(+)
> > >
> > > diff --git a/dracut-kdump.sh b/dracut-kdump.sh
> > > index 2ae1c7c..51a1f73 100755
> > > --- a/dracut-kdump.sh
> > > +++ b/dracut-kdump.sh
> > > @@ -30,15 +30,51 @@ do_dump()
> > >
> > > do_kdump_pre()
> > > {
> > > + local _ret
> > > +
> > > if [ -n "$KDUMP_PRE" ]; then
> > > "$KDUMP_PRE"
> > > + _ret=$?
> > > + if [ $_ret -ne 0 ]; then
> > > + echo "kdump: $KDUMP_PRE exited with $_ret status"
> > > + return $_ret
> > > + fi
> > > + fi
> > > +
> > > + if [ -d /etc/kdump/pre.d ]; then
> > > + for file in `find /etc/kdump/pre.d -type f | sort`; do
> >
> > Since there are no convention here about the order of those files under
> > /etc/kdump/pre.d, there could be risk with just a 'sort'?
> >
> > If in the future one want to add a new pre/post script/binary to be run
> > after some specific files existed, then there is no way to do that
> > reliably.
> >
> > I have no better idea than the dracut ways with some prefix like 01, 02,
> > etc, maybe something better can be introduced?
>
>
> I'm sorry for my late response.
> I don't understand the risk that you thought.
>
> Please tell me the concrete example of the risk.
I have no concrete example, but since the mutiple pre scripts introduced
here we should consider the order of them. make some convention
for example to document that the pre.d/* runs in alphabet order or add
some prefix like 00, 01..
In another word, at least should document about the running order is the
same as the result of the command "sort"
Thanks
Dave