On Tue, 10 Nov 2020 20:17:36 -0600
DJ Lucas via blfs-support <blfs-support@lists.linuxfromscratch.org>
wrote:

> On 11/9/2020 8:47 PM, Scott Andrews via blfs-support wrote:
> > LSB-Tools will fails to create symlinks properly in the following
> > layout:  
> Every instance that I've seen that used that layout rc.d contained 
> symlinks to ../<name> (so '../init.d' works). I was looking at both
> old RedHat and old Debian, where you had:
> 
> /etc/{init,rc{sysinit,0,1,2,3,4,5,6}}.d
> and
> /etc/rc.d/{init,rc{sysinit,0,1,2,3,4,5,6}}.d -> 
> ../{init,rc{sysinit,0,1,2,3,4,5,6}}.d
> 
> <Snip>
> 
> > The error is in install_initd.py line 396  
> 
> That's the same error as the original. That said, even if it works in 
> former instances, it's an error depending on being relative by one
> (or two) path elements. There should be no technical reason that
> initdDir could't be /lib/lsb/my/init/d/dir/init.d/ (I'd have to add
> an environment variable or config file to allow that, but that's
> pretty far outside the norm, so I'm not doing that). You can change
> all three instances of
> 
> target = os.path.join("../../init.d", sname)
> 
> to
> 
> target = os.path.join(os.path.relpath(initdDir, rldir), sname)
> 
> 
> You can run with '-v -d' to keep from trashing your working setup.
> Also need to actually print the link targets, so all of the
> 
> print("Adding", spath)
> 
> need to be
> 
> print("Adding", spath, "->", target)
> 
> 
> I'll get these into git in just a few.
> 
> Thanks for all the testing and the feedback. While it works for LFS, 
> that isn't its only purpose. Bugs can't get fixed using only one 
> configuration. :-) lsbinstall is going to be delayed again anyway,
> that one does quite a bit more and I just haven't had the time to
> finish it yet. Your other catch has already been addressed
> (/etc/rc.d./init.d).
> 
> --DJ
> 

If you move init.d from /etc/rc.d/init.d to /etc/init.d so that init.d
is no longer in the /etc/rc.d fileystem none of the scripts run as
install_initd stills make the symlinks point to the
non-existent /etc/rc.d/init.d directory.  install_initd looks
for /etc/rc.d and then /etc/rc.d/init.d but does not adjust the
symlinks to point to /etc/init.d.  They still are made to point
to /etc/rc.d/init.d directory

I'll have to look at the 
target = os.path.join(os.path.relpath(initdDir, rldir), sname)
to see if I think it will solve this.

Also the init script to bring up swap is too early and needs to be as
follows:

### BEGIN INIT INFO
# Provides:            swap
# Required-Start:      udev $local_fs
# Should-Start:        modules
# Required-Stop:       localnet $local_fs
# Should-Stop:
# Default-Start:       S
# Default-Stop:        0 6
# Short-Description:   Mounts and unmounts swap partitions.
# Description:         Mounts and unmounts swap partitions defined in
#                      /etc/fstab.
# X-LFS-Provided-By:   LFS
### END INIT INFO

Note that $local_fs was added to Required-Start.

This will make swap come up after the local file system is mounted so
that if you are using a swap file instead of a swap partition it
will work. As LFS has it swap partitions will never come up at boot and
you have to manually bring them up.  Bruce is too hard headed to fix
this. Has been broken for a long time.
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to