Systemd-244
      
      
        
          Introduction to systemd
        
        
          While systemd was installed when
          building LFS, there are many features provided by the package that
          were not included in the initial installation because Linux-PAM was not yet installed. The
          systemd package needs to be
          rebuilt to provide a working systemd-logind service, which
          provides many additional features for dependent packages.
        
        
          This package is known to build and work properly using an LFS-9.1
          platform.
        
        
          Package Information
        
        
        
          Additional Downloads
        
        
        
          systemd Dependencies
        
        
          Required
        
        
          Linux-PAM-1.3.1
        
        
          Recommended Runtime Dependencies
        
        
          Polkit-0.116
        
        
          Optional
        
        
          cURL-7.68.0, cryptsetup-2.0.6, git-2.25.0, GnuTLS-3.6.12,
          iptables-1.8.4, libgcrypt-1.8.5,
          libidn2-2.3.0, libseccomp-2.4.2,
          libxkbcommon-0.10.0, make-ca-1.5,
          pcre2-10.34, qemu-4.2.0, Valgrind-3.15.0, zsh-5.8 (for the zsh
          completions), gnu-efi, kexec-tools,
          libmicrohttpd,
          lz4,
          qrencode, quota-tools
          and Sphinx
        
        
          Optional (to rebuild the manual pages)
        
        
          docbook-xml-4.5, docbook-xsl-1.79.2, libxslt-1.1.34, and
          lxml-4.5.0 (to build the index of systemd manual
          pages)
        
        
          User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/systemd
        
       
      
        
          Installation of systemd
        
        
          Apply a patch to fix problems with libseccomp-2.4.2+ and
          Linux-5.4+:
        
        
patch -Np1 -i ../systemd-244-seccomp_and_cpuaffinity_fix-1.patch
        
          Remove an unneeded group, render,
          from the default udev rules:
        
        
sed -i 's/GROUP="render", //' rules.d/50-udev-default.rules.in
        
          Rebuild systemd by running the
          following commands:
        
        
mkdir build &&
cd    build &&
meson --prefix=/usr         \
      --sysconfdir=/etc     \
      --localstatedir=/var  \
      -Dblkid=true          \
      -Dbuildtype=release   \
      -Ddefault-dnssec=no   \
      -Dfirstboot=false     \
      -Dinstall-tests=false \
      -Dldconfig=false      \
      -Dman=auto            \
      -Drootprefix=         \
      -Drootlibdir=/lib     \
      -Dsplit-usr=true      \
      -Dsysusers=false      \
      -Drpmmacrosdir=no     \
      -Db_lto=false         \
      ..                    &&
ninja
        
          
          
            Note
          
          
            For the best test results, make sure you run the testsuite from a
            system that is booted by the same systemd version you are rebuilding.
          
         
        
          To test the results, issue: ninja
          test.
        
        
          
          
            Warning
          
          
            Installing the package will overwrite all files installed by
            systemd in LFS. It is critical
            that nothing uses either systemd
            or Udev libraries during the
            installation. The best way to ensure that these libraries are not
            being used is to run the installation in rescue mode. To switch
            to rescue mode, run the following command as the root user (from a TTY):
          
          
systemctl start rescue.target
         
        
          Now, as the root user:
        
        
ninja install
       
      
        
          Configuring systemd
        
        
          The /etc/pam.d/system-session file
          needs to be modified and a new file needs to be created in order
          for systemd-logind to
          work correctly. Run the following commands as the root user:
        
        
cat >> /etc/pam.d/system-session << "EOF"
# Begin Systemd addition
    
session  required    pam_loginuid.so
session  optional    pam_systemd.so
# End Systemd addition
EOF
cat > /etc/pam.d/systemd-user << "EOF"
# Begin /etc/pam.d/systemd-user
account  required    pam_access.so
account  include     system-account
session  required    pam_env.so
session  required    pam_limits.so
session  required    pam_unix.so
session  required    pam_loginuid.so
session  optional    pam_keyinit.so force revoke
session  optional    pam_systemd.so
auth     required    pam_deny.so
password required    pam_deny.so
# End /etc/pam.d/systemd-user
EOF
        
          At this point, you should reload the systemd daemon, and reenter
          multi-user mode with the following commands (as the root user):
        
        
systemctl daemon-reload
systemctl start multi-user.target
        
          
          
            Warning
          
          
            If upgrading from a previous version of systemd and an initrd is
            used for system boot, you should generate a new initrd before
            rebooting the system.
          
         
       
      
        
          Contents
        
        
          A list of the installed files, along with their short descriptions
          can be found at ../../../../lfs/view/9.1/chapter06/systemd.html#contents-systemd.
        
        
          Listed below are the newly installed libraries and directories
          along with short descriptions.
        
        
          
            
              Installed Programs:
              None
            
            
              Installed Libraries:
              pam_systemd.so (in /lib/security)
            
            
              Installed Directories:
              None
            
           
         
        
          
            Short Descriptions
          
          
            
              
              
            
            
              
                | 
                   
                    pam_systemd.so
                   
                 | 
                
                   
                    is a PAM module used to register user sessions with the
                    systemd login manager,
                    systemd-logind.
                   
                 | 
              
            
          
         
       
      
        Last updated on 2020-02-18 11:26:31 -0800