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

2013-11-27 Thread Hannes Reinecke
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?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries  Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-11-27 Thread Mantas Mikulėnas
On Wed, Nov 27, 2013 at 3:31 PM, Hannes Reinecke h...@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).

-- 
Mantas Mikulėnas graw...@gmail.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-11-27 Thread Hannes Reinecke
On 11/27/2013 02:58 PM, Mantas Mikulėnas wrote:
 On Wed, Nov 27, 2013 at 3:31 PM, Hannes Reinecke h...@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.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries  Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-11-27 Thread Colin Guthrie
'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 h...@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/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-11-27 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Nov 27, 2013 at 03:12:02PM +0100, Hannes Reinecke wrote:
 On 11/27/2013 02:58 PM, Mantas Mikulėnas wrote:
  On Wed, Nov 27, 2013 at 3:31 PM, Hannes Reinecke h...@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 a pragmatic choice: we know that /bin/mount will work both for
separate-/usr and merged-/usr. We *could* introduce a configure time
check for the location of mount, but there would be no practical
gain. Not having /bin at all is very unlikely, since /bin/sh is
hardcoded in many more places.

C.f. https://bugs.freedesktop.org/show_bug.cgi?id=55248, where gentoo
had kexec in a different place. In that case a practical reason
existed.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-11-27 Thread Kay Sievers
On Wed, Nov 27, 2013 at 3:12 PM, Hannes Reinecke h...@suse.de wrote:
 On 11/27/2013 02:58 PM, Mantas Mikulėnas wrote:
 On Wed, Nov 27, 2013 at 3:31 PM, Hannes Reinecke h...@suse.de wrote:
 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 ...

It's not obsoleted, it's still part of the legacy API, which will not
go away anytime soon. In a proper system with only one /usr, the
location does not matter, everything works the same.

 Or, rather, to have a hard-coded location to start with.

We support exactly two configurations:
the (conceptually pointless and confusing) legacy split-/user with
/bin/mount, and the one proper single /usr, where /bin must be a
symlink to /usr/bin.

Nothing else is interesting to support, matters or makes sense in any
way. In both supported configurations /bin/mount works just fine.

In the very long run, we will get rid of the split-/usr support and at
that point just hard-code things like /usr/bin/mount; there is no need
really for a configuration switch here.

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-11-27 Thread Karel Zak
On Wed, Nov 27, 2013 at 04:41:27PM +0100, Kay Sievers wrote:
 We support exactly two configurations:
 the (conceptually pointless and confusing) legacy split-/user with
 /bin/mount, and the one proper single /usr, where /bin must be a
 symlink to /usr/bin.

BTW, it's not about systemd only. The same is valid for 
/sbin/{mount,fsck,mkfs}.fs helpers, agetty where we call /bin/login,
etc. etc.

 Nothing else is interesting to support, matters or makes sense in any
 way. In both supported configurations /bin/mount works just fine.
 
 In the very long run, we will get rid of the split-/usr support and at
 that point just hard-code things like /usr/bin/mount; there is no need
 really for a configuration switch here.

Yep.

Karel

-- 
 Karel Zak  k...@redhat.com
 http://karelzak.blogspot.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-11-27 Thread Lennart Poettering
On Wed, 27.11.13 14:31, Hannes Reinecke (h...@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?

Well, /bin/mount is kinda API of Linux, you cannot just change that. All
systems must provide that, the same way as /bin/sh, reagrdless whether
/ and /usr is merged or not. There's really not much point in making this
configurable, we don't really want to support systems which move things
wildly around into the strangest places.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-11-27 Thread Lennart Poettering
On Wed, 27.11.13 15:12, Hannes Reinecke (h...@suse.de) wrote:

 On 11/27/2013 02:58 PM, Mantas Mikulėnas wrote:
  On Wed, Nov 27, 2013 at 3:31 PM, Hannes Reinecke h...@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.

systemd supports split /usr just fine really.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel