Re: How to move vi to /bin
2009/5/14 Mel Flynn : > On Thursday 14 May 2009 12:38:30 Chris Rees wrote: >> 2009/5/13 Mel Flynn : >> > On Wednesday 13 May 2009 11:34:43 Michael Powell wrote: >> >> Kind of like how those coming over from a >> >> Linux environment all seem to want to change root's shell to bash, it >> >> serves no purpose except foot-shooting. >> > >> > - csh cannot redirect stderr seperately from stdout >> > - on pipes the exit status from the first command is the exit status of >> > the total command >> > - will not expand matches without a user provided part, for *every* >> > component of a path >> > >> > There's plenty of reasons not to use csh and if you know what you're >> > doing, BSD lets you. And no, I don't want to type exec zsh when I'm >> > finally logged into the box that has a load of 100+. >> >> I think the problem with that is he meant changing the root shell to >> /usr/local/bin/bash. You're better off using /bin/sh if you want a >> Bourne-type shell, or using toor with /usr/local/bin/bash. > > sh is worse then csh. What do you mean by that? What is 'worse' about /bin/sh? It has none of the quirks csh has. > > On Thursday 14 May 2009 18:03:25 Chad Perrin wrote: > >> I've never understood the resistance to just use toor instead of root if >> one wants a nonstandard administrative shell. > > Habit, mostly. toor is one way of doing things, just changing the shell is the > other. Maybe it's my paranoia that I might be running software that does > string matches for root logins, rather then uid to disallow access ;) Your software is broken then, and you should email the maintainer. I doubt that ever actually happens. Chris -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
Manish Jain wrote: > Mel Flynn wrote: >> On Wednesday 13 May 2009 09:21:46 manish jain wrote: >> >>> I want to move vi to /bin so that I have an editor available in >>> single-user mode. [snip] > > From all the discussion I have walked through on the issue of where to > place vi, it does appear FreeBSD has a skewed policy on the issue. There > are plenty of reasons you might need access an editor in single-user > mode - editing fstab is just one. Having to use the workarounds > suggested in place of vi is not so good, and manually moving vi to /bin > is not simply a matter of 'mv /usr/bin/vi /bin/'. > > One of the things I would dearly like to see in a future release is vi > being placed under /bin. > Why not just simply type /rescue/vi at the prompt? It'll function in single user mode and allow for things like editing fstab, etc. So simple, why complicate matters... -Mike ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
On Friday 15 May 2009 08:46:46 Manish Jain wrote: > Mel Flynn wrote: > > On Wednesday 13 May 2009 09:21:46 manish jain wrote: > >> I want to move vi to /bin so that I have an editor available in > >> single-user mode. > > > > The only reason to need an editor and not have /usr and /var available is > > to edit /etc/fstab. It is trivial to spot errors with /rescue/cat and fix > > with /rescue/sed, without having to worry about a terminal. > > > > In all other cases: > > fsck -p > > /etc/rc.d/mountcritlocal start > > /etc/rc.d/ldconfig start > > > > And one can use any editor one would want. Don't forget to export or > > setenv TERM to cons25 from 'dumb'. > > From all the discussion I have walked through on the issue of where to > place vi, it does appear FreeBSD has a skewed policy on the issue. There > are plenty of reasons you might need access an editor in single-user > mode - editing fstab is just one. You didn't read what I wrote. The above works in single user mode and does not magically transform you to multi-user. Just reboot in single user mode, type the above and then /usr/bin/vi /etc/rc.conf. You will see that it works. In fact, if you have vim installed, /usr/local/bin/vim /etc/rc.conf will work. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
On Thu, May 14, 2009 at 10:03:58PM -0700, per...@pluto.rain.com wrote: > Chris Rees wrote: > > 2009/5/14 Chad Perrin : > > > On Thu, May 14, 2009 at 11:38:30AM +0100, Chris Rees wrote: > > >> I think the problem with that is he meant changing the root > > >> shell to /usr/local/bin/bash. You're better off using /bin/sh > > >> if you want a Bourne-type shell, or using toor with > > >> /usr/local/bin/bash. > > > > > > I've never understood the resistance to just use toor instead > > > of root if one wants a nonstandard administrative shell. > > > > People don't seem to understand that toor and root are equivalent. > > Well, not entirely. "su" uses root's shell, not toor's, AFAIK. Actually, `su` uses whatever you tell it to: su toor . . . though the default is root, you don't have to use the default. -- Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] Perrin's Principle of Inclusion: The strength of any system is directly proportional to the power of the tools it provides for the general public. pgpCNnsl6STm4.pgp Description: PGP signature
Re: How to move vi to /bin
Manish Jain wrote: > From all the discussion I have walked through on the issue of > where to place vi, it does appear FreeBSD has a skewed policy > on the issue. There are plenty of reasons you might need access > an editor in single-user mode - editing fstab is just one. > Having to use the workarounds suggested in place of vi is not > so good, and manually moving vi to /bin is not simply a matter > of 'mv /usr/bin/vi /bin/'. > > One of the things I would dearly like to see in a future release > is vi being placed under /bin. Maybe put something like this [untested] in /bin/vi: #!/bin/sh [ -x /usr/bin/vi ] && exec /usr/bin/vi "$@" exec /rescue/vi "$@" That should run /usr/bin/vi if it's available, else fall back to /rescue/vi. Beats linking /rescue/vi into /bin, since that would cause the statically-linked version to be used by anyone who has /bin ahead of /usr/bin in PATH, even when the dynamically-linked version is available. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
Manish Jain wrote: Mel Flynn wrote: On Wednesday 13 May 2009 09:21:46 manish jain wrote: I want to move vi to /bin so that I have an editor available in single-user mode. The only reason to need an editor and not have /usr and /var available is to edit /etc/fstab. It is trivial to spot errors with /rescue/cat and fix with /rescue/sed, without having to worry about a terminal. In all other cases: fsck -p /etc/rc.d/mountcritlocal start /etc/rc.d/ldconfig start And one can use any editor one would want. Don't forget to export or setenv TERM to cons25 from 'dumb'. From all the discussion I have walked through on the issue of where to place vi, it does appear FreeBSD has a skewed policy on the issue. There are plenty of reasons you might need access an editor in single-user mode - editing fstab is just one. Having to use the workarounds suggested in place of vi is not so good, and manually moving vi to /bin is not simply a matter of 'mv /usr/bin/vi /bin/'. One of the things I would dearly like to see in a future release is vi being placed under /bin. There is an alternative means of achieving the same effect which I have been occasionally known to advocate on this and other lists: the all-in-one partition layout. Simply put, when installing the system instead of creating separate /, /usr, /var etc. etc. partitions, you create only two partitions: a swap area and (covering all the rest of the disk) one big partition mounted at /. This means that in single user mode, dynamically linked programs like vi(1) are available as normal. It's easy to implement and it works well. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW signature.asc Description: OpenPGP digital signature
Re: How to move vi to /bin
Mel Flynn wrote: On Wednesday 13 May 2009 09:21:46 manish jain wrote: I want to move vi to /bin so that I have an editor available in single-user mode. The only reason to need an editor and not have /usr and /var available is to edit /etc/fstab. It is trivial to spot errors with /rescue/cat and fix with /rescue/sed, without having to worry about a terminal. In all other cases: fsck -p /etc/rc.d/mountcritlocal start /etc/rc.d/ldconfig start And one can use any editor one would want. Don't forget to export or setenv TERM to cons25 from 'dumb'. From all the discussion I have walked through on the issue of where to place vi, it does appear FreeBSD has a skewed policy on the issue. There are plenty of reasons you might need access an editor in single-user mode - editing fstab is just one. Having to use the workarounds suggested in place of vi is not so good, and manually moving vi to /bin is not simply a matter of 'mv /usr/bin/vi /bin/'. One of the things I would dearly like to see in a future release is vi being placed under /bin. -- Regards Manish Jain invalid.poin...@gmail.com Laast year I kudn't spell Software Engineer. Now I are won. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
Chris Rees wrote: > 2009/5/14 Chad Perrin : > > On Thu, May 14, 2009 at 11:38:30AM +0100, Chris Rees wrote: > >> I think the problem with that is he meant changing the root > >> shell to /usr/local/bin/bash. You're better off using /bin/sh > >> if you want a Bourne-type shell, or using toor with > >> /usr/local/bin/bash. > > > > I've never understood the resistance to just use toor instead > > of root if one wants a nonstandard administrative shell. > > People don't seem to understand that toor and root are equivalent. Well, not entirely. "su" uses root's shell, not toor's, AFAIK. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
On Thu, 14 May 2009 20:13:02 +0200, Mel Flynn wrote: > sh is worse then csh. But sufficient for administration tasks in maintenance mode. It's not that you spend hours of dialog sessions in SUM. Remember: It's a worst case scenario. If everything fails, the /bin/sh still works, and it helps you get things working again. It's not that I would like to use sh as a dialog shell, there are definitely better ones. But it's the system's standard scripting shell, and sufficient for recovering a defective system. > And I said if you know what you're doing. My root shell > is less prone to break then the standard csh shell, because I compile it > statically (and also on the / partition). That's a completely valid solution - better than just chsh and then trouble. :-) -- 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 "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
On Wednesday 13 May 2009 09:21:46 manish jain wrote: > I want to move vi to /bin so that I have an editor available in > single-user mode. The only reason to need an editor and not have /usr and /var available is to edit /etc/fstab. It is trivial to spot errors with /rescue/cat and fix with /rescue/sed, without having to worry about a terminal. In all other cases: fsck -p /etc/rc.d/mountcritlocal start /etc/rc.d/ldconfig start And one can use any editor one would want. Don't forget to export or setenv TERM to cons25 from 'dumb'. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
On Thursday 14 May 2009 12:38:30 Chris Rees wrote: > 2009/5/13 Mel Flynn : > > On Wednesday 13 May 2009 11:34:43 Michael Powell wrote: > >> Kind of like how those coming over from a > >> Linux environment all seem to want to change root's shell to bash, it > >> serves no purpose except foot-shooting. > > > > - csh cannot redirect stderr seperately from stdout > > - on pipes the exit status from the first command is the exit status of > > the total command > > - will not expand matches without a user provided part, for *every* > > component of a path > > > > There's plenty of reasons not to use csh and if you know what you're > > doing, BSD lets you. And no, I don't want to type exec zsh when I'm > > finally logged into the box that has a load of 100+. > > I think the problem with that is he meant changing the root shell to > /usr/local/bin/bash. You're better off using /bin/sh if you want a > Bourne-type shell, or using toor with /usr/local/bin/bash. sh is worse then csh. And I said if you know what you're doing. My root shell is less prone to break then the standard csh shell, because I compile it statically (and also on the / partition). On Thursday 14 May 2009 18:03:25 Chad Perrin wrote: > I've never understood the resistance to just use toor instead of root if > one wants a nonstandard administrative shell. Habit, mostly. toor is one way of doing things, just changing the shell is the other. Maybe it's my paranoia that I might be running software that does string matches for root logins, rather then uid to disallow access ;) -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
2009/5/14 Chad Perrin : > On Thu, May 14, 2009 at 11:38:30AM +0100, Chris Rees wrote: >> 2009/5/13 Mel Flynn : >> > On Wednesday 13 May 2009 11:34:43 Michael Powell wrote: >> > >> >> Kind of like how those coming over from a >> >> Linux environment all seem to want to change root's shell to bash, it >> >> serves no purpose except foot-shooting. >> > >> > - csh cannot redirect stderr seperately from stdout >> > - on pipes the exit status from the first command is the exit status of the >> > total command >> > - will not expand matches without a user provided part, for *every* >> > component >> > of a path >> > >> > There's plenty of reasons not to use csh and if you know what you're doing, >> > BSD lets you. And no, I don't want to type exec zsh when I'm finally logged >> > into the box that has a load of 100+. >> >> I think the problem with that is he meant changing the root shell to >> /usr/local/bin/bash. You're better off using /bin/sh if you want a >> Bourne-type shell, or using toor with /usr/local/bin/bash. > > I've never understood the resistance to just use toor instead of root if > one wants a nonstandard administrative shell. > People don't seem to understand that toor and root are equivalent. Or their muscle memory says 'root'! -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
On Thu, May 14, 2009 at 11:38:30AM +0100, Chris Rees wrote: > 2009/5/13 Mel Flynn : > > On Wednesday 13 May 2009 11:34:43 Michael Powell wrote: > > > >> Kind of like how those coming over from a > >> Linux environment all seem to want to change root's shell to bash, it > >> serves no purpose except foot-shooting. > > > > - csh cannot redirect stderr seperately from stdout > > - on pipes the exit status from the first command is the exit status of the > > total command > > - will not expand matches without a user provided part, for *every* > > component > > of a path > > > > There's plenty of reasons not to use csh and if you know what you're doing, > > BSD lets you. And no, I don't want to type exec zsh when I'm finally logged > > into the box that has a load of 100+. > > I think the problem with that is he meant changing the root shell to > /usr/local/bin/bash. You're better off using /bin/sh if you want a > Bourne-type shell, or using toor with /usr/local/bin/bash. I've never understood the resistance to just use toor instead of root if one wants a nonstandard administrative shell. -- Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] Quoth Anonymous: "It is easier to measure something than to understand what you have measured." pgpLxGzSrBdxA.pgp Description: PGP signature
Re: How to move vi to /bin
2009/5/13 Mel Flynn : > On Wednesday 13 May 2009 11:34:43 Michael Powell wrote: > >> Kind of like how those coming over from a >> Linux environment all seem to want to change root's shell to bash, it >> serves no purpose except foot-shooting. > > - csh cannot redirect stderr seperately from stdout > - on pipes the exit status from the first command is the exit status of the > total command > - will not expand matches without a user provided part, for *every* component > of a path > > There's plenty of reasons not to use csh and if you know what you're doing, > BSD lets you. And no, I don't want to type exec zsh when I'm finally logged > into the box that has a load of 100+. I think the problem with that is he meant changing the root shell to /usr/local/bin/bash. You're better off using /bin/sh if you want a Bourne-type shell, or using toor with /usr/local/bin/bash. Chris -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
On Wed, 13 May 2009 05:34:43 -0400, Michael Powell wrote: > Yes - use the /rescue/vi as it has been statically compiled so it does not > rely on dynamic libraries which may not be available. The purpose here is > have a fallback position for repairing a damage/problem which may prevent a > successful mount of /usr. In addition, you eventually want to do something about the termcap files that - at least I think - vi needs to run in a usable manner. The default is /etc/termcap@ -> /usr/share/misc/termcap - and in a "worst case scenario" /usr is out of reach. You can copy the file /usr/share/misc/termcap to /etc, run "cap_mkdb /etc/termcap" and then have /etc/termcap and /etc/termcap.db, which you can then symlink to /usr/share/misc/termcap and /usr/share/misc/termcap.db again. But note that this might lead to interferences with the freebsd-update tool as well as with the canonical way of updating the system through "make update" and "make build/install kernel/world". -- 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 "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
On Wednesday 13 May 2009 11:34:43 Michael Powell wrote: > Kind of like how those coming over from a > Linux environment all seem to want to change root's shell to bash, it > serves no purpose except foot-shooting. - csh cannot redirect stderr seperately from stdout - on pipes the exit status from the first command is the exit status of the total command - will not expand matches without a user provided part, for *every* component of a path There's plenty of reasons not to use csh and if you know what you're doing, BSD lets you. And no, I don't want to type exec zsh when I'm finally logged into the box that has a load of 100+. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
Chris Rees wrote: >> On Wed, May 13, 2009 at 12:51:46PM +0530, manish jain wrote: >>> I want to move vi to /bin so that I have an editor available in >>> single-user mode. This sounds simple (and should be if all you have is >>> a single partition), but there are problems. For starters, terminfo >>> can't locate its database in single-user mode. >>> >>> Could anyone please tell me how to go about this on a 7.x system ? I >>> am also curious to know why FreeBSD doesn't place vi under /bin in the >>> first place. > > You may also have a problem, because IIRC /usr/bin/vi is dynamically > linked with stuff in /usr/lib. Try it, it may work. It's probably why > it's in /usr/bin. > > Or just use /rescue/vi as Andrew suggested! > Yes - use the /rescue/vi as it has been statically compiled so it does not rely on dynamic libraries which may not be available. The purpose here is have a fallback position for repairing a damage/problem which may prevent a successful mount of /usr. There really is nothing to be gained by cluttering up / with stuff that doesn't really belong there and can only bring problems later when you've forgotten what you've done. Kind of like how those coming over from a Linux environment all seem to want to change root's shell to bash, it serves no purpose except foot-shooting. -Mike ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
El miércoles 13 de mayo a las 09:21:46 CEST, manish jain escribió: > Hi, > > I want to move vi to /bin so that I have an editor available in > single-user mode. This sounds simple (and should be if all you have is > a single partition), but there are problems. For starters, terminfo > can't locate its database in single-user mode. > > Could anyone please tell me how to go about this on a 7.x system ? I > am also curious to know why FreeBSD doesn't place vi under /bin in the > first place. Try /rescue/vi in single user mode. Before that, you must copy /usr/share/misc/termcap.db to /root/.termcap.db (/root is the HOME of user root). Best regards. pgp1W7b5kEWf4.pgp Description: PGP signature
Re: How to move vi to /bin
> On Wed, May 13, 2009 at 12:51:46PM +0530, manish jain wrote: >> I want to move vi to /bin so that I have an editor available in >> single-user mode. This sounds simple (and should be if all you have is >> a single partition), but there are problems. For starters, terminfo >> can't locate its database in single-user mode. >> >> Could anyone please tell me how to go about this on a 7.x system ? I >> am also curious to know why FreeBSD doesn't place vi under /bin in the >> first place. You may also have a problem, because IIRC /usr/bin/vi is dynamically linked with stuff in /usr/lib. Try it, it may work. It's probably why it's in /usr/bin. Or just use /rescue/vi as Andrew suggested! Chris -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: How to move vi to /bin
On Wed, May 13, 2009 at 12:51:46PM +0530, manish jain wrote: > I want to move vi to /bin so that I have an editor available in > single-user mode. This sounds simple (and should be if all you have is > a single partition), but there are problems. For starters, terminfo > can't locate its database in single-user mode. > > Could anyone please tell me how to go about this on a 7.x system ? I > am also curious to know why FreeBSD doesn't place vi under /bin in the > first place. Why not mount /usr? As I understand it, the usual criterion is that only things that are necessary to get the other partitions mounted go in the root partition; everything else goes under /usr. I don’t know if this is the case with FreeBSD, but I don’t know of any other. -- Benjamin M. A’Lee || mail: b...@subvert.org.uk web: http://bma.subvert.org.uk/ || gpg: 0x166891C7 pgp0MNUAHdTag.pgp Description: PGP signature
Re: How to move vi to /bin
On Wed 2009-05-13 12:51:46 UTC+0530, manish jain (invalid.poin...@gmail.com) wrote: > I want to move vi to /bin so that I have an editor available in > single-user mode. You may be able to use /rescue/vi. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
How to move vi to /bin
Hi, I want to move vi to /bin so that I have an editor available in single-user mode. This sounds simple (and should be if all you have is a single partition), but there are problems. For starters, terminfo can't locate its database in single-user mode. Could anyone please tell me how to go about this on a 7.x system ? I am also curious to know why FreeBSD doesn't place vi under /bin in the first place. Thank you and Regards Manish Jain invalid.poin...@gmail.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"