[systemd-devel] Hard-coded /bin/mount in systemd

Colin Guthrie gmane at colin.guthr.ie
Wed Nov 27 06:38:33 PST 2013


'Twas brillig, and Hannes Reinecke at 27/11/13 14:12 did gyre and gimble:
> On 11/27/2013 02:58 PM, Mantas Mikulėnas wrote:
>> On Wed, Nov 27, 2013 at 3:31 PM, Hannes Reinecke <hare at suse.de> wrote:
>>>
>>> Hi all,
>>>
>>> for some reason systemd has /bin/mount hardcoded in
>>> src/core/mount.c:mount_enter_mounting()
>>>
>>> Which is a bit odd, seeing that everyting moved to /usr/bin.
>>> So we always have to do a symlink here, which really is a bit annoying.
>>>
>>> Is this by design or a simple left-over?
>>
>> If *everything* moved to /usr/bin, then /bin itself has to be a
>> symlink anyway (as many tools expect and some standards require
>> specific commands to be in /bin).
>>
> Ah. IIRC it was _systemd_ which initiated the move to /usr, so I
> found it slightly odd to rely on a location which it has just
> obsoleted ...
> Or, rather, to have a hard-coded location to start with.

It's essentially just a practicality thing.

Although "systemd" thinks that a split /usr setup is crack, it *is*
still supported (see the --enable-split-usr option to configure)

Despite being blamed for the sky falling in because systemd printed a
warning message (and that is all!) when it was started when /usr is not
available, it does still try and cope and mount it. If all is well then
there will be no major ill effects

So if it it were not hard coded it would still have to support calling
it both as /bin/mount or /usr/bin/mount via some kind of conditional
(based on the --enable-split-usr configure switch) which will be uglier
in the code. If we know that a properly managed/unified /usr will always
have a /bin -> /usr/bin symlink, then this conditional is not needed and
the filesystem just takes care of it for us. This is how it's done just now.

Hope that explains it a bit.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list