On Sat, May 13, 2017 at 06:18:57PM -0500, Bruce Dubbs wrote: > Alan Feuerbacher wrote: > > In various places the LFS and BLFS books state that it's generally > > recommended to compile packages as an unprivileged user, then become the > > root user when installing the software (e.g. BLFS book, ch. 2, Notes on > > Building Software). When switching to root, should this be done with a > > login shell or non-login shell? I.e.: > > > > su root > > or > > su - root (or su --login root) > > > > Further on in BLFS, "sudo" is installed, so I suppose that would be > > appropriate to use. > > It's easier to use a subshell 'su' and not a login shell 'su -'. The > obvious reason is that 'su -' will take you to /root and you will have to > change the current directory back to the build directory. > > For building many packages, it is much easier to use sudo with the build > user set with NOPASSWD: or setting the variable passwd_timeout in the > sudoers file to a longer value, say 240 for 4 hours. > > Neither should be used in a production system. > For most packages it is possible to build as root, but don't say I suggested it ;-) Seriously, if this is not a production system and you have asked yourself if you feel lucky, it can be convenient.
Exceptions include the development version of clisp, and (apparently) libreoffice (that bit me ages ago, but then I got away with it until recently). Of course, if you do that then you will be classed as "adventurous" with all the negative connotations that can add. For people who hold up their hands in horror at the very idea of building as root, please also note that a few packages will error out in a DESTDIR install if a user tries to do that (but for those, root can successfully DESTDIR). Building software is a game. But seriously, every different approach has plusses and minuses: if I'm the user who can build things and install via sudo without a password (or as a member of the wheel group, or whatever) it doesn't actually provide any protection if I really meant to do a DESTDIR install as my regular user but inadvertently typed the real install command. Having your wits about you is always desirable. Whichever way you chooose, enjoy BLFS. ĸen -- I live in a city. I know sparrows from starlings. After that everything is a duck as far as I'm concerned. -- Monstrous Regiment -- http://lists.linuxfromscratch.org/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
