Updating the ports index is slow, but system load is nil
Hi, Sometimes (not always) when I do a 'portupgrade', it takes _ages_ to update the ports index, without actually placing any noticeable load on the system. In ports/UPDATING, it says (of make index) This may take an undesirably long time.. That would be fine, *if it were doing any work*. I try to speed it up by reniceing all the processes I can pin down as belonging to the portupgrade (is there a recursive renice for child processes?), but it makes no difference. Here's a grab of top, after I've been staring at Updating the ports index ... Generating INDEX.tmp - please wait.. for about 10 minutes PID USERNAME PRI NICE SIZERES STATETIME WCPUCPU COMMAND 65942 rich 1010 37396K 27732K select 0:01 4.18% 2.39% kdeinit 62156 rich 960 52072K 40144K select 0:04 1.69% 1.56% kontact 557 root 960 102M 48316K select 15:39 0.88% 0.88% Xorg 67154 root 8 -5 7304K 7180K wait 0:00 2.96% 0.54% make 67520 root 8 -5 928K 800K wait 0:00 3.00% 0.15% make notice that a) there's almost no load on the system b) I managed to catch some of the make's and renice them c) It didn't help These two makes soon disappeared from the top of the list, leaving only background processes. It doesn't have any open network connections, so I'm not waiting for a remote machine; it doesn't have any system load so I'm not waiting for processing; the hard disk is (largely) idle, so I'm not waiting for i/o, but I am still waiting! How can I make it stop messing around and get on with it? Thanks, Rich ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: reconfigure php4-extensions
On Thursday 03 February 2005 01:45, albi wrote: Richard Bradley wrote: Now I want to install some extensions that I didn't choose the first time round, but I can't get the menu to reappear. I have tried: make clean make make deinstall make reinstall make configure you might want to try : make distclean that did the trick for me afair Thanks very much. I'm not sure what did the trick in the end, but some combined effect of the following commands sorted it out: make config (brought up the menu!) make (returned as if everything was already compiled) make distclean (did some work) make(returned as if everything was already compiled) make install (compiled the new extension, then asked for a deinstall) make deinstall make reinstall Where is this documented (i.e. is there any way I could have found this out for myself)? Rich ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
reconfigure php4-extensions
Hi, When I installed php4 from a port, I also installed php4-extensions. It gave me an ncurses menu to choose from possible extensions. Now I want to install some extensions that I didn't choose the first time round, but I can't get the menu to reappear. I have tried: make clean make make deinstall make reinstall make configure All of which complete normally, but don't present the menu for me to change the options. What should I do to add a new extension? Many thanks, Rich ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Designed for FreeBSD stickers
On Wednesday 08 December 2004 3:41 am, Matthias Buelow wrote: Richard Bradley wrote: ScotGold seems reasonably priced, but once you've bought their minimum order of 10, you're again paying almost £5. Is there a gap in the market? the question is if that would be economical. do you also buy paper clips one at a time? :) For the vendors, perhaps not, but I've only got one pc :-(, whereas I've got lots of paper. 1 Case badge: 35p + 5p VAT 1st class postage (up to 60g): 28p Total: 68p I'd pay a pound or two to compensate for the low volume, but I don't really want to spend £5 on 68 pence of goods :-( Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Designed for FreeBSD stickers
Chris Hill wrote: On Wed, 8 Dec 2004, Matthias Buelow wrote: Rod Person wrote: Powered By FreeBSD badge... http://www.freebsdmall.com/cgi-bin/fm/bsdplate?id=RQKmKeZumv_pc=88 I got a batch years ago from ScotGold, which might be nearer for European buyers than freebsdmall: http://www.scotgold.com/acatalog/ScotGold_Catalogue_BSD_Daemon_Stuff_3.html I think I got mine from Scot as well, but they don't seem to read Powered by FreeBSD anymore. What's on Scot's page now seems to be also available at http://www.case-badges.com/free_bsd_daemon_badges.html Does anyone know of somewhere (cheap) in the UK that I can get just one badge from? The best I could find with google was this German place: http://62.75.177.102/shop2/?user=cwgbrbproid=88sid=a179900ec54c79f47d2e6a8330aaf89a With a bit of help from Babelfish (!) I reckon they're selling stickers for 1 euro each, which is cheap enough for me, but I think pp was 5 euros, bringing the whole package to nearly £5! ScotGold seems reasonably priced, but once you've bought their minimum order of 10, you're again paying almost £5. Is there a gap in the market? Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
How to run a stream based command in place on a file
Hi, I want to run stream based commands like `sed` and `tr` on the contents of a file, and save the results to the same file. Obviously I can do this with a temporary file: $sed s/dog/cat/ myanimals.txt tmp.txt $mv tmp.txt myanimals.txt But is there any way I can do this with a single command? My first guess would be a buffer command that reads a file into memory (or into a temp file) then pipes it to stdout, e.g. $cat myanimals.txt | buffer | sed s/dog/cat/ myanimals.txt But there isn't one which, in my experience of BSD, means it either wouldn't work or there is a better way to do it :-) Having read through the Bash manual and run some experiments, it seems that the operator truncates an output file to zero length before any commands are run. So my missing command becomes: $cat myanimals.txt | sed s/dog/cat | bufferedwrite myanimals.txt I can't find anything like this anywhere -- any ideas what the proper way to do this is? Thanks in advance, Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: how to make an executable run as another user
I understand now. Thanks very much for all your help. Rich On Saturday 18 September 2004 11:31 am, Matthew Seaman wrote: On Fri, Sep 17, 2004 at 04:53:31PM -0400, mailing lists at MacTutor wrote: QUOTE: In most UNIX kernels there exists what is called a 'race condition' when executing scripts. Scripts are pieces of code which are interpreted by, strangely enough, interpreters. Common examples of interpreters are perl, sed, and awk. So when you have in your perl code #!/usr/local/bin/perl it tells the operating system to start executing the perl interpreter with the current script as input. Between the time that the perl interpreter starts executing and the time that it reads in your script the 'race condition' exists. At this time, a mischievous person could 'win the race' and be able to replace your script with another. And if your script is running as setuid, that person's script would run as your user! So their script could do anything that you could do from the command line. As a result, most UNIX kernels will disable users from running scripts as setuid. The most common way around this is to create a wrapper program around your script. A wrapper, in this context, is a small program, possibly written in C, that when executed will simply run your script. The 'race condition' does not exist for real executables and so you won't be thwarted by the kernel itself. Actually, this should no longer be a problem in any up to date version of Unix. The race condition between the kernel reading the script to find what interpreter to invoke, and the interpreter then to read and interpret the script was solved by having the kernel pass an open filedescriptor on the script file to the interpreter. One way of testing if your OS supports this is the presence of 'file descriptor' devices under /dev -- eg. under FreeBSD you get: happy-idiot-talk:/usr/local/etc:% ls -la /dev/fd/* crw-rw-rw- 1 root wheel 22, 0 Jul 5 17:08 /dev/fd/0 crw-rw-rw- 1 root wheel 22, 1 Jul 5 17:08 /dev/fd/1 crw-rw-rw- 1 root wheel 22, 2 Jul 5 17:08 /dev/fd/2 crw-rw-rw- 1 root wheel 22, 3 Jul 5 17:08 /dev/fd/3 crw-rw-rw- 1 root wheel 22, 4 Jul 5 17:08 /dev/fd/4 crw-rw-rw- 1 root wheel 22, 5 Jul 5 17:08 /dev/fd/5 crw-rw-rw- 1 root wheel 22, 6 Jul 5 17:08 /dev/fd/6 crw-rw-rw- 1 root wheel 22, 7 Jul 5 17:08 /dev/fd/7 crw-rw-rw- 1 root wheel 22, 8 Jul 5 17:08 /dev/fd/8 crw-rw-rw- 1 root wheel 22, 9 Jul 5 17:08 /dev/fd/9 [...] However, the horror has been so beaten into the collective unconscious inherited from earlier days of Unix that shell scripts are still automatically stripped of any setuid or setgid bits by default on most Unix variants. I did see a setuid 'lp' script as a standard part of the lp system on a Solaris 8 box once -- took me a long time to convince myself it was actually safe. Cheers, Matthew ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
how to make an executable run as another user
Um. I feel silly asking this. But I can't work it out. I want a shell script to run as another user. I always thought this was easy to do with the setuid bit, but never tried it before. I read man chmod and found this: . 4000(the setuid bit). Executable files with this bit set will run with effective uid set to the uid of the file owner. . s The set-user-ID-on-execution and set-group-ID-on-execution bits. And off I went. I wrote a shell script to output the current uid. I chown'ed it to another user. I chmod +sed it. I ran it. It didn't work. - rtb27# cat test #! /bin/sh whoami rtb27# ll test -rwsr-sr-x 1 rich wheel 20 Sep 17 19:34 test rtb27# ./test root Um. Help? Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
/rescue is huge!!
Hi everyone, I recently tried to add a user to my FreeBSD box, but was amazed to find that the / partition was full! I had a look, and the culprit is the /rescue folder, holding 135 statically linked binaries of nearly 4Mb each, giving a folder size of 491Mb! The Handbook says that 100 MB is a reasonable size for this filesystem. You will not be storing too much data on it, as a regular FreeBSD install will put about 40 MB of data here. (§ 2.5.5). I gave my root partition what I thought was a generous 512Mb. What is going on here? I read the rescue manpage, and while it might be a nice thing to fall back on, I can't justify it over being able to add user accounts. Should I just delete this lot? Should I have a bigger / partition? Is the handbook out of date in this respect? (/rescue was added in 5.2) All comments welcome... Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
user account woes
Hi, I have a phantom user stuck in my system that I can neither use nor delete. I have been playing with Virtual Users in pure-ftpd and it seems to have messed things around. Substituting `bob` for the user name, here is some of my command line: # grep bob /etc/passwd /etc/pwd.db # pw add user lindalepark pw: user 'bob' already exists # grep lindale /etc/passwd /etc/pwd.db /etc/passwd:lindalepark:*:1003:1003:User :/home/lindalepark:/bin/sh # pw del user bob pw: no such user `bob' If I delete the entry from /etc/passwd, the cycle starts again. Any hints? Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: /rescue is huge!!
On Tuesday 06 July 2004 2:36 am, you wrote: In the last episode (Jul 06), Richard Bradley said: I recently tried to add a user to my FreeBSD box, but was amazed to find that the / partition was full! I had a look, and the culprit is the /rescue folder, holding 135 statically linked binaries of nearly 4Mb each, giving a folder size of 491Mb! Check the inode number of each file in /rescue (ls -li /rescue). You'll notice they're all the same, which means they're all hardlinks to the same file. du /rescue should report under 4MB. Your space is probably being taken up somewhere else. That's very strange if true, because since deleting the /rescue folder, the used space on / has gone from 550Mb+ to 129Mb. I can't check the inodes now, as I have `rm`ed them all! Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: /rescue [may or may not have actually been] huge!!
On Tuesday 06 July 2004 3:11 am, you wrote: On Tuesday, 6 July 2004 at 2:59:08 +0100, Richard Bradley wrote: On Tuesday 06 July 2004 2:36 am, Dan Nelson wrote: Check the inode number of each file in /rescue (ls -li /rescue). You'll notice they're all the same, which means they're all hardlinks to the same file. du /rescue should report under 4MB. Your space is probably being taken up somewhere else. That's very strange if true, because since deleting the /rescue folder, I'm a little irritated by the use of the term folder. Do you mean mail? /rescue is a directory. Yes, I mean directory. I switch between unix and the other OS family and sometimes get sloppy with my terminology. Apologies. the used space on / has gone from 550Mb+ to 129Mb. How do you measure this? If you created a 100 MB partition or thereabouts, you can't store 550 MB in it. I measured this using kdf. The partition size is 512Mb. I was unable to write to the partition, and df was reporting 120% disk usage. Since I rm'ed the / rescue directory, kdf reports 23% disk usage and I can write to the partition. I thought that all the space was being used by /rescue, because kdirstat reported the size of the directory at ~400Mb, but after some experimentation, it appears kdirstat counts multi-linked files once for each link, so the directory may not have been taking up all that space. Regardless of the accuracy of kdf and kdirstat, I did receive a disk full message from pw on a partition which now has 380Mb free, so something funny is going on... 100 MB should be plenty of space for the root file system assuming that you have separate /usr and /var file systems (not something that I recommend, but that's what the handbook recommends). I'd guess that you've made some mistake somewhere and have been confused by the concept of links. I have almost certainly made a mistake somewhere, but my goal is to find out what and not to repeat it. Things seem to be ok now (apart from I have no rescue dir). As far as I can tell, I understand links, but one can rarely know what one doesn't know ;-) Regards, Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
IMPS/2 for mouse-wheel not supported
Hi, I have a brand new Microsoft optical wheel mouse with a 'tilt wheel'. It works as a 3-button mouse under X with: Option Protocol PS/2 Option Device/dev/psm0 but the wheel doesn't work (i.e. doesn't even show up in `xev`) The X documentation: [ http://www.xfree86.org/current/mouse6.html ] seems to suggest that I use either IMPS/2 or ExplorerPS/2, but both of these fail with Protocol not supported. Does FreeBSD support PS/2 mouse initialization (which the above link says is required for these protocols)? Is there a kernel module I need to enable this? Any help would be much appreciated. Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: IMPS/2 for mouse-wheel not supported
On Tue 2004-05-18 (16:23), Richard Bradley wrote: Hi, I have a brand new Microsoft optical wheel mouse with a 'tilt wheel'. It works as a 3-button mouse under X but the wheel doesn't work (i.e. doesn't even show up in `xev`) The X documentation: [ http://www.xfree86.org/current/mouse6.html ] seems to suggest that I use either IMPS/2 or ExplorerPS/2, but both of these fail with Protocol not supported. On Tuesday 18 May 2004 5:42 pm, John Oxley wrote: Here is an excerpt from my XF86Config Option ProtocolAuto Option Device /dev/sysmouse Option ZAxisMapping 4 5 You may also want to include Option Buttons 5 I have tried Protocol as Auto, but it had the same effect. I have also tried using `moused` and /dev/sysmouse, in each case, everything works fine, except the mouse only has 3 buttons and no scroll. (I've tried the -z flag to moused as well) This mouse is a replacement for another wheel mouse (different brand) which worked fine. Even when I didn't have ZAxisMapping set up, the wheel showed up as a button in `xev`. Cheers, Rich On Tue 2004-05-18 (16:23), Richard Bradley wrote: Hi, I have a brand new Microsoft optical wheel mouse with a 'tilt wheel'. It works as a 3-button mouse under X with: Option Protocol PS/2 Option Device/dev/psm0 but the wheel doesn't work (i.e. doesn't even show up in `xev`) The X documentation: [ http://www.xfree86.org/current/mouse6.html ] seems to suggest that I use either IMPS/2 or ExplorerPS/2, but both of these fail with Protocol not supported. Does FreeBSD support PS/2 mouse initialization (which the above link says is required for these protocols)? Is there a kernel module I need to enable this? Any help would be much appreciated. Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Keeping Ports synchronised with Packages
Hi all, I am getting the impression that I am using the ports and packages system the wrong way, but can't find a good tutorial on how to use them to their best. I would be quite happy to write one up, but I need to understand it first! My problem is that my ports tree is always a couple of minor versions ahead of the available packages. (I use `cvsup /usr/share/examples/cvsup/ports-supfile` as suggested in the handbook) If I add a program with e.g. #portinstall gaim it compiles it from source, and updates a load of libraries and dependent ports to the current versions. This means I have a load of libraries that are different versions to those the precompiled packages expect, and some packages even refuse to install. I end up having to install more and more things from the ports, which is slooow (do you have any idea how long it takes to compile kde?) and creates even more problems if I try to use a package. What am I doing wrong? Is there a way to hold back cvsup to the same version as the packages on FreeBSD.org? On a related note, where do the errors from sysinstall go? It refers to the debug screen but I can't find it on any terminal. What about if you run it in a konsole or xterm? Any pointers would be much appreciated. All the best, Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping Ports synchronised with Packages
On Thursday 22 April 2004 2:29 pm, Andrew L. Gould wrote: On Thursday 22 April 2004 07:41 am, Richard Bradley wrote: [...] My problem is that my ports tree is always a couple of minor versions ahead of the available packages. [...] This means I have a load of libraries that are different versions to those the precompiled packages expect, and some packages even refuse to install. The way to update your system source and hold back package/port versions is to refuse ports. See: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html Alternatively, you can continue to cvsup ports and then upgrade your packages to newer versions using the port portupgrade, which can be found at /usr/ports/sysutils/portsupgrade. Best of luck, Andrew Gould Perhaps I am confused about the terminology here - by packages I mean precompiled programs, and by ports I mean source code make files for the same programs. I want to keep my programs up to date, and I want to use precompiled versions as much as possible because it can take hours to compile a large program. However some programs don't have packages, or the packages won't install because I have used the ports system and other, required, programs are out of sync. If I use `portupgrade -PP` (i.e. forcing it to use packages) it (almost) always fails because there are never precompiled packages of the same version as my (cvsup'ed) ports tree. In the same way, `portupgrade -P` (i.e. try to use packages) is equivalent to `portupgrade` (i.e. compile from source) because of the version lag in the packages as compared to the ports. One solution might be to get cvsup to check out slightly older versions of the port tree that matches up with the available packages. However this doesn't seem possible. Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping Ports synchronised with Packages
On Thursday 22 April 2004 3:25 pm, Andrew L. Gould wrote: On Thursday 22 April 2004 08:57 am, Richard Bradley wrote: ... I want to keep my programs up to date, and I want to use precompiled versions as much as possible because it can take hours to compile a large program. ... If I use `portupgrade -PP` (i.e. forcing it to use packages) it (almost) always fails because there are never precompiled packages of the same version as my (cvsup'ed) ports tree. In the same way, `portupgrade -P` (i.e. try to use packages) is equivalent to `portupgrade` (i.e. compile from source) because of the version lag in the packages as compared to the ports. ... Portupgrade uses the package database of installed applications, which (to my knowledge) doesn't care/know whether the package was installed from a binary or from the port system. This assumes that the binary package registered the application with the package database. If you're using third-party, binary packages that do not register themselves with the package database, keeping applications in sync will probably become a manual process. Yep. 'portupgrade -arRP' will upgrade all of the installed packages where it can find a binary package or the related port, with a preference for binary packages. If it completes successfully, your packages (binary and port) should be in sync. As long as you don't update your ports tree, it should be easy to keep them in sync. Yes, this can take a long time. To shorten the process, I pkg_delete Open Office and few other huge packages prior to portupgrade. I then manually install the newer binaries after everything else has been upgraded. If I don't update the ports tree, won't portupgrade look for the old versions of programs? Without updating the ports, portupgrade won't have anything to do, as all my programs would appear to be the current version. Wouldn't they? Also, if you recompile the system and kernel, your entire system will be in sync! That would take _days_! Perhaps this is ok for a server, but I am trying to use FreeBSD as a desktop system here. It's taking me all afternoon to re-install eclipse (you have to compile java) as things stand. Rich ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]