From: Karel Zak <kzak@redhat.com>
To: Ruediger Meier <sweet_f_a@gmx.de>
Cc: Mike Frysinger <vapier@gentoo.org>,
util-linux@vger.kernel.org, Isaac Dunham <ibid.ag@gmail.com>
Subject: Re: question about hardcoded binary paths (swapon / mkswap)
Date: Wed, 1 Apr 2015 23:38:00 +0200 [thread overview]
Message-ID: <20150401213800.GB2097@ws.net.home> (raw)
In-Reply-To: <201504012306.52737.sweet_f_a@gmx.de>
On Wed, Apr 01, 2015 at 10:06:52PM +0100, Ruediger Meier wrote:
> > > If "swapon" was called from PATH then just take mkswap from PATH
> > > too. If "/whatever/path/swapon" was called then look for mkswap in
> > > the same path.
It seems like over-engineering. The primary goal are regular
installations, the stuff in the test/ should not be a reason to change
important things in the utils.
> > > Maybe both cases also with or without fallback $sbindir, /sbin or
> > > $PATH.
> > >
> > > I guess we should agree how somthing like this should be handeled
> > > in general. "eject" is also using hardcoded "/bin/umount".
> >
> > seems like $PATH should always be used. if you broke $PATH, well
Yes, agree.
Note that we already have and use FS_SEARCH_PATH in mkfs, fsck and
mount (libmount), see --enable-fs-paths-default and --enable-fs-paths-extra.
Maybe we can use it use FS_SEARCH_PATH also for mkswap in swapon, or use it
as fallback.
> The only special thing here is IMO that mkswap and swapon belong to the
> same project. Should we try to use the right one per default?
>
> Example:
> UL is installed below /usr/local
> PATH="/usr/local/sbin:/sbin"
>
> Explicitly invoking the (old) globally installed /sbin/swapon should use
> the old /sbin/mkswap too or the new /usr/local/sbin/mkswap from PATH?
I'd like to avoid complex and not obvious semantic. It's fine to
follow PATH or harcoded FS_SEARCH_PATH.
> Another point:
> If "/sbin" is not in PATH should "sudo /sbin/swapon" find /sbin/mkswap
> or not?
Is it really our problem? I don't think we have to provide solutions
for all crazy scenarios...
Note that for critical things (for example things important for system
boot, etc.) there should be always hardcoded fallback.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2015-04-01 21:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-01 11:42 question about hardcoded binary paths (swapon / mkswap) Ruediger Meier
2015-04-01 13:38 ` Isaac Dunham
2015-04-01 16:17 ` Ruediger Meier
2015-04-01 20:10 ` Mike Frysinger
2015-04-01 21:06 ` Ruediger Meier
2015-04-01 21:38 ` Karel Zak [this message]
2015-04-02 1:12 ` Mike Frysinger
2015-04-02 8:20 ` Karel Zak
2015-04-02 16:19 ` Mike Frysinger
2015-04-02 19:15 ` Karel Zak
2015-04-02 22:50 ` Ruediger Meier
2015-04-03 1:15 ` Mike Frysinger
2015-04-03 8:52 ` Karel Zak
2015-04-03 23:16 ` Mike Frysinger
2015-04-02 17:28 ` Isaac Dunham
2015-04-01 22:23 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150401213800.GB2097@ws.net.home \
--to=kzak@redhat.com \
--cc=ibid.ag@gmail.com \
--cc=sweet_f_a@gmx.de \
--cc=util-linux@vger.kernel.org \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox