Re: root /etc/csh
On Sun, Nov 16, 2008 at 2:41 AM, Jeremy Chadwick [EMAIL PROTECTED] wrote: On Sun, Nov 16, 2008 at 12:22:11AM -0800, [EMAIL PROTECTED] wrote: [...] A statically-linked version of bash would waste significant amounts of memory, while a dynamically-linked/shared version would ease that pain. The same applies for any static vs. dynamic program. How so? Wouldn't a single in-memory instance of the bash text segment be shared among all bash processes, across all users? http://lists.freebsd.org/pipermail/freebsd-stable/2007-August/thread.html#36647 http://lists.freebsd.org/pipermail/freebsd-stable/2007-August/036654.html In response to the original post: The kernel's ELF linker/loader for executables will share the text and read-only segments for static executables. This is consistent with my understanding. A statically-linked bash will consume more space on disk, and more memory the first time it is loaded, but as with any other executable, the executable portion of the program will be re-used each time another bash is run. But I am not a developer or a kernel engineer, so if there is a way in which a statically-compiled bash ends up consuming more memory on each invocation for some reason, I'd appreciate an explanation as to why. Sincerely, -daniel -- http://dannyman.toldme.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Mon, Nov 17, 2008 at 11:45:52AM -0800, Daniel Howard wrote: On Sun, Nov 16, 2008 at 2:41 AM, Jeremy Chadwick [EMAIL PROTECTED] wrote: On Sun, Nov 16, 2008 at 12:22:11AM -0800, [EMAIL PROTECTED] wrote: [...] A statically-linked version of bash would waste significant amounts of memory, while a dynamically-linked/shared version would ease that pain. The same applies for any static vs. dynamic program. How so? Wouldn't a single in-memory instance of the bash text segment be shared among all bash processes, across all users? http://lists.freebsd.org/pipermail/freebsd-stable/2007-August/thread.html#36647 http://lists.freebsd.org/pipermail/freebsd-stable/2007-August/036654.html In response to the original post: The kernel's ELF linker/loader for executables will share the text and read-only segments for static executables. This is consistent with my understanding. A statically-linked bash will consume more space on disk, and more memory the first time it is loaded, but as with any other executable, the executable portion of the program will be re-used each time another bash is run. We didn't get an answer to Oliver's question (see the bottom half of his mail): http://lists.freebsd.org/pipermail/freebsd-stable/2007-August/036653.html But I am not a developer or a kernel engineer, so if there is a way in which a statically-compiled bash ends up consuming more memory on each invocation for some reason, I'd appreciate an explanation as to why. Someone would need to go through and determine using nm or objdump (if possible), combined with procstat -v, to find how much would get wasted. It also depends on what options bash was built with. For example, I use WITHOUT_NLS everywhere, which decreases the overall footprint a bit. My (dynamic) bash binary on my box at home only links to libc and libncurses. As it stands presently, I am under the belief that the benefits of shared/dynamic outweigh static for specific environments. I think I mentioned it earlier in my mail, but on a machine with 1500 shell users, the benefits of shared/dynamic stand out (think: sshd and bash). I do understand your point and where you're coming from, though. It might not matter as much for bash, but I also worry the attitude would start to get applied to other shells (like zsh, which is *heavily* shared/dynamic). -- | Jeremy Chadwickjdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
... Why doesn't FreeBSD ship bash and other shells besides the `sh' linked statically is beyond me. It wouldn't break ports, would it? It does break ports. Very, very badly. I know because I've personally attempted replacing /bin/sh with bash as a I have a weekend to spare project. You misunderstand. I do not suggest replacing the standard shell with bash, I suggest that the shells available in FreeBSD, even through ports to be linked statically so they can be used for rescue and recovery. If the default make instructions told to compile statically, it wouldn't break the ports. You're right -- I'm still not understanding. So let me cover the bases here: 1) The entire ports and FreeBSD build system (see: world) rely heavily on /bin/sh-isms and do not work with bash. bash being compiled statically will not solve these problems. If this is accurate, it should be reported to the bash maintainers as a bug. Bash claims complete Posix compatibility (plus extensions). In any event, it is irrelevant to the OP's point. 2) Changing the root users' shell is not recommended. There are a lot of reasons for this, but as mentioned, the main one is single-user scenarios (where /usr hasn't been mounted yet, thus /usr/local/bin/bash is not available -- and if it's installed as /bin/bash, the libraries /bin/bash link to are not available). This, of course, being the whole point of the OP's suggestion to link port shells statically. 3) You can build bash statically; make WITH_STATIC_BASH=true. I do not know the true reason why the port is not built statically by default, but I can give you a damn good reason why it shouldn't be: complete and total wasted memory. Take into consideration environments where there are hundreds (or at my place of work, thousands) of users logged into a machine at once. Many of those are going to have /usr/local/bin/bash as their shell. A statically-linked version of bash would waste significant amounts of memory, while a dynamically-linked/shared version would ease that pain. The same applies for any static vs. dynamic program. How so? Wouldn't a single in-memory instance of the bash text segment be shared among all bash processes, across all users? Granted, there is, in effect, *one* extra instance of the part of libc that gets linked into the static bash. A better reason is that security updates to shared libs often update only the .so files, expecting the binaries that use them to automatically pick up the new versions. Any static executable should be rebuilt any time there is a security update to a shared lib that it would be using were it linked dynamically. That said, perhaps it would be reasonable for shell ports to build both a dynamically-linked instance to be installed in /usr/local/bin, and a statically-linked instance to be installed in, say, /usr/local/static. Those who want to use bash as the root shell could copy it from there to /bin or /sbin. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Fri, Nov 14, 2008 at 10:20:26PM +0100, Polytropon typed: On Fri, 14 Nov 2008 11:49:35 -0800 (PST), GESBBB [EMAIL PROTECTED] wrote: By the way, this also works with Perl as you no doubt know. I cannot count how many times I have installed a Perl script and then had to modify the 'shebang' in order to get it to work in FBSD. I know that I could probably make some symbolic links or whatever; however, I feel that, that is the wrong way to get things to work properly. That's correct. Adding symlinks to structures controlled by the package management system or the OS itself can lead into problems. Well, the link is created automatically by the port, so you should never have had to modify any 'shebang' # ls -l `which perl` lrwxr-xr-x 1 root wheel 24 Nov 27 2007 /usr/bin/perl - /usr/local/bin/perl5.8.8 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Sun, Nov 16, 2008 at 12:22:11AM -0800, [EMAIL PROTECTED] wrote: 3) You can build bash statically; make WITH_STATIC_BASH=true. I do not know the true reason why the port is not built statically by default, but I can give you a damn good reason why it shouldn't be: complete and total wasted memory. Take into consideration environments where there are hundreds (or at my place of work, thousands) of users logged into a machine at once. Many of those are going to have /usr/local/bin/bash as their shell. A statically-linked version of bash would waste significant amounts of memory, while a dynamically-linked/shared version would ease that pain. The same applies for any static vs. dynamic program. How so? Wouldn't a single in-memory instance of the bash text segment be shared among all bash processes, across all users? http://lists.freebsd.org/pipermail/freebsd-stable/2007-August/thread.html#36647 A better reason is that security updates to shared libs often update only the .so files, expecting the binaries that use them to automatically pick up the new versions. Any static executable should be rebuilt any time there is a security update to a shared lib that it would be using were it linked dynamically. Yup, that's another reason. That said, perhaps it would be reasonable for shell ports to build both a dynamically-linked instance to be installed in /usr/local/bin, and a statically-linked instance to be installed in, say, /usr/local/static. Those who want to use bash as the root shell could copy it from there to /bin or /sbin. This part of the thread should be moved to freebsd-ports, or obrien@ pulled in here. -- | Jeremy Chadwickjdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Sun, 16 Nov 2008 09:44:28 +0100 Ruben de Groot [EMAIL PROTECTED] wrote: [snip] Well, the link is created automatically by the port, so you should never have had to modify any 'shebang' # ls -l `which perl` lrwxr-xr-x 1 root wheel 24 Nov 27 2007 /usr/bin/perl - /usr/local/bin/perl5.8.8 I am not talking about installing from ports; but rather, Perl scripts that I have downloaded from various sites. These inevitably have the setting for Perl wrong for a FreeBSD system. By the way, on my system, the output is slightly different. ~ $ ls -l `which perl` -rwxr-xr-x 2 root wheel 9536 May 3 2008 /usr/local/bin/perl* -- Jerry [EMAIL PROTECTED] The streets are safe in Philadelphia, it's only the people who make them unsafe. Mayor Frank Rizzo signature.asc Description: PGP signature
Re: root /etc/csh
On Sat, 15 Nov 2008 01:19:57 -0500, [EMAIL PROTECTED] wrote: Why doesn't FreeBSD ship bash and other shells besides the `sh' linked statically is beyond me. It wouldn't break ports, would it? I can't speak for FreeBSD's developers, but I think it's a primary philosophy to provide only a set of basic means by the base system, instead of a more or less complete collection of shells, just for the case that someone might want it. Well, bash, zsh or ksh are very powerful tools, but those who want them will surely install them right after the base system. Furthermore, there are those users who are not interested in those shells at all (maybe because they're using GUI stuff only, or maybe because they're completely happy with sh for scriting and csh for dialog mode). For UNIX compati- bility, /bin/sh is sufficient, and csh, configured properly, is an excellent dialog shell. FreeBSD isn't a shell collection, it's an operating system. :-) Just as a sidenote, when you put this into /etc/csh.cshrc, your csh will behave (except scripting constructs, of course) somewhat like bash: set promptchars = %# set prompt = [EMAIL PROTECTED]:%~%# set autolist or set promptchars = # set prompt = [EMAIL PROTECTED] %~ %# set autolist -- Polytropon From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Sat, Nov 15, 2008 at 01:19:57AM -0500, [EMAIL PROTECTED] wrote: isn't the main reason because other shells may reside on a filesystem which isn't necessarily mounted in maintenance/single user mode? Or, libraries for the same? -- Jim Pazarena [EMAIL PROTECTED] Just link the shell of your choice statically and put it somewhere in /. Problem solved. Why doesn't FreeBSD ship bash and other shells besides the `sh' linked statically is beyond me. It wouldn't break ports, would it? It does break ports. Very, very badly. I know because I've personally attempted replacing /bin/sh with bash as a I have a weekend to spare project. The topic of bringing bash into BSD as /bin/sh has been discussed in the past many, many times. It's always a heated discussion. We went through the same thing discussing bringing tcsh in (remember, /bin/csh is tcsh). -- | Jeremy Chadwickjdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
Jeremy Chadwick([EMAIL PROTECTED])@2008.11.15 18:32:39 -0800: Problem solved. Why doesn't FreeBSD ship bash and other shells besides the `sh' linked statically is beyond me. It wouldn't break ports, would it? It does break ports. Very, very badly. I know because I've personally attempted replacing /bin/sh with bash as a I have a weekend to spare project. You misunderstand. I do not suggest replacing the standard shell with bash, I suggest that the shells available in FreeBSD, even through ports to be linked statically so they can be used for rescue and recovery. If the default make instructions told to compile statically, it wouldn't break the ports. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Sat, Nov 15, 2008 at 10:36:24PM -0500, Dan wrote: Jeremy Chadwick([EMAIL PROTECTED])@2008.11.15 18:32:39 -0800: Problem solved. Why doesn't FreeBSD ship bash and other shells besides the `sh' linked statically is beyond me. It wouldn't break ports, would it? It does break ports. Very, very badly. I know because I've personally attempted replacing /bin/sh with bash as a I have a weekend to spare project. You misunderstand. I do not suggest replacing the standard shell with bash, I suggest that the shells available in FreeBSD, even through ports to be linked statically so they can be used for rescue and recovery. If the default make instructions told to compile statically, it wouldn't break the ports. You're right -- I'm still not understanding. So let me cover the bases here: 1) The entire ports and FreeBSD build system (see: world) rely heavily on /bin/sh-isms and do not work with bash. bash being compiled statically will not solve these problems. 2) Changing the root users' shell is not recommended. There are a lot of reasons for this, but as mentioned, the main one is single-user scenarios (where /usr hasn't been mounted yet, thus /usr/local/bin/bash is not available -- and if it's installed as /bin/bash, the libraries /bin/bash link to are not available). 3) You can build bash statically; make WITH_STATIC_BASH=true. I do not know the true reason why the port is not built statically by default, but I can give you a damn good reason why it shouldn't be: complete and total wasted memory. Take into consideration environments where there are hundreds (or at my place of work, thousands) of users logged into a machine at once. Many of those are going to have /usr/local/bin/bash as their shell. A statically-linked version of bash would waste significant amounts of memory, while a dynamically-linked/shared version would ease that pain. The same applies for any static vs. dynamic program. -- | Jeremy Chadwickjdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Wed, Nov 12, 2008 at 02:14:07PM -0500, Jerry wrote: I usually just use: #!/usr/bin/env bash It seems to work on both Linux and FBSD. That does work -- as long as you have bash installed. How portable do you want your script to be? -- Chad Perrin [ content licensed PDL: http://pdl.apotheon.org ] Quoth Sterling Camden: The Church doesn't want people calling for inquisitions. pgp4YFWISV7og.pgp Description: PGP signature
Re: root /etc/csh
From: Chad Perrin [EMAIL PROTECTED] On Wed, Nov 12, 2008 at 02:14:07PM -0500, Jerry wrote: I usually just use: #!/usr/bin/env bash It seems to work on both Linux and FBSD. That does work -- as long as you have bash installed. How portable do you want your script to be? The point is that I would want it to work seamlessly between different flavors of *nix and FBSD. Since there seems to be a lack of consistency as to where 'Bash' is installed on different OSs, I find that using the notation I described works best and seems to improve the portability of the scripts. Since most of the scripts that I write are 'Bash' specific anyway, the fact that it would not work if Bash was not installed is of little importance. By the way, this also works with Perl as you no doubt know. I cannot count how many times I have installed a Perl script and then had to modify the 'shebang' in order to get it to work in FBSD. I know that I could probably make some symbolic links or whatever; however, I feel that, that is the wrong way to get things to work properly. Just my 2¢. -- Jerry ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Fri, 14 Nov 2008 11:49:35 -0800 (PST), GESBBB [EMAIL PROTECTED] wrote: The point is that I would want it to work seamlessly between different flavors of *nix and FBSD. Since there seems to be a lack of consistency as to where 'Bash' is installed on different OSs, I find that using the notation I described works best and seems to improve the portability of the scripts. Since most of the scripts that I write are 'Bash' specific anyway, the fact that it would not work if Bash was not installed is of little importance. I'm not sure if you can assume /usr/bin/env exactly in this position on every UNIX system. In order to gain maximum portability, keep things simple and try to use sh as scripting shell. If that's not possible, you could add a check (using which) for bash's availability, outputting to stderr if bash is not present, just like a kind of wrapper script that calls your bash specific script. Maybe that's not very elegant, but it seems to be a good solution. By the way, this also works with Perl as you no doubt know. I cannot count how many times I have installed a Perl script and then had to modify the 'shebang' in order to get it to work in FBSD. I know that I could probably make some symbolic links or whatever; however, I feel that, that is the wrong way to get things to work properly. That's correct. Adding symlinks to structures controlled by the package management system or the OS itself can lead into problems. -- Polytropon From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
isn't the main reason because other shells may reside on a filesystem which isn't necessarily mounted in maintenance/single user mode? Or, libraries for the same? -- Jim Pazarena [EMAIL PROTECTED] Just link the shell of your choice statically and put it somewhere in /. Problem solved. Why doesn't FreeBSD ship bash and other shells besides the `sh' linked statically is beyond me. It wouldn't break ports, would it? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Wed, 12 Nov 2008 08:06:16 +0100 Polytropon [EMAIL PROTECTED] wrote: Especially in Linux, it's common to prefix scripts with #!/bin/bash which won't work in FreeBSD, because it's #/usr/local/bin/bash there. Linux has no problem running #!/bin/sh scripts because there's a symlink /bin/sh - /bin/bash. My advice for maximum interoperability and compatibility between Linux and UNIX: If you're not using any bash specific techniques in your scripts, start them with #!/bin/sh instead of #!/bin/bash. The sh shell is the UNIX standard scripting shell, while Linux's one is bash. I usually just use: #!/usr/bin/env bash It seems to work on both Linux and FBSD. -- Jerry [EMAIL PROTECTED] His life was formal; his actions seemed ruled with a ruler. signature.asc Description: PGP signature
Re: root /etc/csh
On Mon, Nov 10, 2008 at 04:13:54PM -0800, Jim Pazarena wrote: Glen Barber wrote: On Mon, Nov 10, 2008 at 4:46 PM, Pieter Donche [EMAIL PROTECTED] wrote: FreeBSD 7.0 comes with the user root with start up shell /bin/csh As normal user I use bash (/usr/local/bin/bash installed) I would prefer to have bash also when working as root (su). It is never recommended to change root's default shell to something outside of the base install. The main reason is, for example, if you update your non-base shell (via ports), and it breaks, you can no longer log in as root. If you decide you still want to have a non-base shell for your root user, keep root's shell default, and enable your toor user. isn't the main reason because other shells may reside on a filesystem which isn't necessarily mounted in maintenance/single user mode? Or, libraries for the same? Probably is the main reason, though another is that some things may be written assuming a particular shell. Not a good practice, but happens. jerry -- Jim Pazarena [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Tue, 11 Nov 2008 10:13:02 -0500, Jerry McAllister [EMAIL PROTECTED] wrote: Probably is the main reason, though another is that some things may be written assuming a particular shell. Not a good practice, but happens. Especially in Linux, it's common to prefix scripts with #!/bin/bash which won't work in FreeBSD, because it's #/usr/local/bin/bash there. Linux has no problem running #!/bin/sh scripts because there's a symlink /bin/sh - /bin/bash. My advice for maximum interoperability and compatibility between Linux and UNIX: If you're not using any bash specific techniques in your scripts, start them with #!/bin/sh instead of #!/bin/bash. The sh shell is the UNIX standard scripting shell, while Linux's one is bash. -- Polytropon From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
root /etc/csh
FreeBSD 7.0 comes with the user root with start up shell /bin/csh As normal user I use bash (/usr/local/bin/bash installed) I would prefer to have bash also when working as root (su). Of course I can do # bash [root ~]# or I could change the startup shell in /etc/passwd, but would that be a wise thing to do or not? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Mon, 10 Nov 2008 22:46:57 +0100 (CET) Pieter Donche [EMAIL PROTECTED] wrote: I could change the startup shell in /etc/passwd, but would that be a wise thing to do or not? we use zsh, but have left the root shell the way it is. if something goes wrong with zsh (or whatever), then it may be difficult to get in as root, possibly. besides, we can still become root with su -lm l for Simulate a full login ... and m for Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made ... -- In friendship, prad ... with you on your journey Towards Freedom http://www.towardsfreedom.com (website) Information, Inspiration, Imagination - truly a site for soaring I's ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Mon, Nov 10, 2008 at 1:46 PM, Pieter Donche [EMAIL PROTECTED] wrote: FreeBSD 7.0 comes with the user root with start up shell /bin/csh As normal user I use bash (/usr/local/bin/bash installed) I would prefer to have bash also when working as root (su). Of course I can do # bash [root ~]# or I could change the startup shell in /etc/passwd, but would that be a wise thing to do or not? If your system is having a bad time, falling back to statically-linked /bin/csh can help you out in a jam, whereas pointing way off to /usr/local/bin/bash could spell trouble if say, you can not mount /usr. As prad pointed out, you can su -m. I myself prefer sudo -s. You could also just type bash. Sincerely, -daniel -- http://dannyman.toldme.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Mon, Nov 10, 2008 at 4:46 PM, Pieter Donche [EMAIL PROTECTED] wrote: FreeBSD 7.0 comes with the user root with start up shell /bin/csh As normal user I use bash (/usr/local/bin/bash installed) I would prefer to have bash also when working as root (su). Of course I can do # bash [root ~]# or I could change the startup shell in /etc/passwd, but would that be a wise thing to do or not? It is never recommended to change root's default shell to something outside of the base install. The main reason is, for example, if you update your non-base shell (via ports), and it breaks, you can no longer log in as root. If you decide you still want to have a non-base shell for your root user, keep root's shell default, and enable your toor user. -- Glen Barber If you have any trouble sounding condescending, find a Unix user to show you how it's done. --Scott Adams ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
Glen Barber wrote: On Mon, Nov 10, 2008 at 4:46 PM, Pieter Donche [EMAIL PROTECTED] wrote: FreeBSD 7.0 comes with the user root with start up shell /bin/csh As normal user I use bash (/usr/local/bin/bash installed) I would prefer to have bash also when working as root (su). It is never recommended to change root's default shell to something outside of the base install. The main reason is, for example, if you update your non-base shell (via ports), and it breaks, you can no longer log in as root. If you decide you still want to have a non-base shell for your root user, keep root's shell default, and enable your toor user. isn't the main reason because other shells may reside on a filesystem which isn't necessarily mounted in maintenance/single user mode? Or, libraries for the same? -- Jim Pazarena [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Mon, 10 Nov 2008 16:13:54 -0800, Jim Pazarena [EMAIL PROTECTED] wrote: Glen Barber wrote: On Mon, Nov 10, 2008 at 4:46 PM, Pieter Donche [EMAIL PROTECTED] wrote: FreeBSD 7.0 comes with the user root with start up shell /bin/csh As normal user I use bash (/usr/local/bin/bash installed) I would prefer to have bash also when working as root (su). It is never recommended to change root's default shell to something outside of the base install. The main reason is, for example, if you update your non-base shell (via ports), and it breaks, you can no longer log in as root. If you decide you still want to have a non-base shell for your root user, keep root's shell default, and enable your toor user. isn't the main reason because other shells may reside on a filesystem which isn't necessarily mounted in maintenance/single user mode? Or, libraries for the same? At least, it's a valid reason. When in trouble, the system just mounts / as ro where /bin/sh (the system's standard scripting shell) and /bin/csh (its standard dialog shell) are available. Bash may be on another partition that's not mounted yet, so no maintenance access would be possible. To change the shell, it's not a good idea to fiddle around with /etc/passwd. The use of the chsh (change shell) command is advised. In my opinion, you could add bash as the last line of your ~/.login file which will be executed by csh, so bash starts up right after login, but NB this may cause problems when using sudo. -- Polytropon From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Tuesday 11 November 2008 00:19:32 Daniel Howard wrote: On Mon, Nov 10, 2008 at 1:46 PM, Pieter Donche [EMAIL PROTECTED] wrote: FreeBSD 7.0 comes with the user root with start up shell /bin/csh As normal user I use bash (/usr/local/bin/bash installed) I would prefer to have bash also when working as root (su). Of course I can do # bash [root ~]# or I could change the startup shell in /etc/passwd, but would that be a wise thing to do or not? If your system is having a bad time, falling back to statically-linked /bin/csh /bin/csh is not statically linked. /rescue/csh is. can help you out in a jam, whereas pointing way off to /usr/local/bin/bash could spell trouble if say, you can not mount /usr. More likely trouble scenario is gettext library version bump. However, bash can be statically compiled by the port and you can also set $PREFIX to /, so it gets installed as /bin/bash. That said, you should before you change root's shell have dealt with a broken root shell a few times, to be able to ascertain whether this extra problem is something you want to deal with, at the times you already have a more pressing problem to solve. As prad pointed out, you can su -m. I myself prefer sudo -s. Unfortunately, sudo -i is not a substitute for su -l, as sudo tries to be more secure then it should be, cleaning the environment, preserving PATH, rather then taking the correct values from /etc/login.conf. Most notably tilde and dollar sign expansion, which are great *shell-independant* features: $ grep setenv /etc/login.conf :setenv=MAIL=/var/mail/$,BLOCKSIZE=M,FTP_PASSIVE_MODE=YES,PACKAGES=/var/pkg/7-stable,PKG_PATH=/var/pkg/7-stable\c. \c/home/$/packages,CCACHE_DIR=/var/db/ccache/$:\ $ echo {$CCACHE_DIR:=No} /var/db/ccache/mel $ echo $MAIL /var/mail/mel $ sudo -c root -i # echo ${CCACHE_DIR:=No} No # echo $MAIL /var/mail/mel -- Mel Problem with today's modular software: they start with the modules and never get to the software part. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: root /etc/csh
On Tuesday 11 November 2008 06:38:54 Polytropon wrote: On Mon, 10 Nov 2008 16:13:54 -0800, Jim Pazarena [EMAIL PROTECTED] wrote: isn't the main reason because other shells may reside on a filesystem which isn't necessarily mounted in maintenance/single user mode? Or, libraries for the same? At least, it's a valid reason. When in trouble, the system just mounts / as ro where /bin/sh (the system's standard scripting shell) and /bin/csh (its standard dialog shell) are available. Bash may be on another partition that's not mounted yet, so no maintenance access would be possible. In single user mode, no login is done at all and the path to the shell is asked for. When a system comes to halt at boot, it will go to single user mode. If it doesn't make it there, then not much is lost anyway by rebooting and pressing 4 when chuck greets you. The problem is lies with remote logins through means of ssh and being unable to change to root, to - for example - change the shell ;) -- Mel Problem with today's modular software: they start with the modules and never get to the software part. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]