CentOS 5 :: Find -print0 The Order Of The Args Matters?
Jun 14, 2010
In the man page for find there is an example for deleting core files from /tmp: find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f
which I am sure does what was intended. However, this very similar command does something quite different: find /tmp -print0 -name core -type f | xargs -0 /bin/rm -f
This actually removes all files in /tmp, ignoring the -name and -type arguments. I checked the man page to see if it detailed this behaviour, but the only reference to the order of the arguments was that -name should come before -type to prevent excessive calls to stat(2) on all files. This seems very risky behaviour on the part of find and I am concerned about whether this is a bug or not. I wasn't trying to remove core files from /tmp when I found this out, but deleting other files from another part of the filesystem .
I attended many interviews for Linux Admin post. Most of them asked me a common question 'How do you handle System Performance Issues' on a Linux Server. Now how do I answer this?
Ubuntu 10.04 LTS - the Lucid Lynx Dual Boot with Windwos Vista Level - beginner (started today 07/0810)
I have just given Linux a try for the first time and so far its not proving to be a good experience. I have so far just tried to install a couple of basic programs I am familiar with and ones suggested by Lifehacker.I wanted to install Tweetdeck, which meant installing Adobe Air. I duly downloaded Adobe Air but it then says I need to choose an application to open it. Assuming that the bin file was a zip file I looked in the software centre and found 7zip. Told it to load that but then couldn't find where it was. Its not listed in the Applications drop down (top right) so I found 'search for a file' and entered *7zip* to be shown 5 files. All but one appear to be a form of image file the other (7zip.desktop) isn't an exe either. Double clicking on it just gets me the following in something called gedit.
I then gave up and used google to find the program and download it, but just came across the same problem. Why oh why is there not some default program already loaded for unzipping files? How can I find 7Zip (I have already looked in the bin folder on the system drive but nothing there) and run it to tell it to make itself the default for unzipping files?
Both are reverse of each other. Now, basically if you see, the contents are same, but in different order. Is there any easy way in which i can find out like which items dont match between 2 files, regardless of order. Lets say i add 10.1.4.1 to File1. Now the result of such comparison should be only '10.1.4.1'. Currently if i am comparing both files using diff, it gives me all the lines.
I just want to know how to monitor urls using nagios.i.e running web applications under tomcat. can any one pleasAe provide me links or docs that narrates,how to configure nagios in a way to monitor our web applications. we already configured nagios for monitoring remote servers load,login details, disk space etc. But we could not find any documents for configuring nagios in order to monitor webapplications.
I'm trying to ssh my ubuntu laptop with my android phone. But with the app I have (connectbot) I don't seem to be able to pass any args to the command. I want to pass the -Y command to allow my phone access to the screen on my laptop so i can use my laptop (somewhat) from my phone. Can you change the args passed to the command while it is running?
I have some network switches that I can login to via ssh and run commandline arguments (not a bash environment). Is there an way/app out there that would allow me to pass commandline arguments to the switch then wait and get the command output. ALl this over ssh?
this message is a bit long but I've been pulling my hair for 2 days now. I am installing Centos 5.3 on a Dell Powerege R610, x86_64 flavour. That part goes well. next is testing backup & restore. I've tried MondoArchive, that I used on other OS, but it fails to remount the LVM correctly, and disk formatting fails. Now, I am trying another way: boot with centos 5.3 i386 live cd, take the disks online, cpio to a usb file everything but: /tmp /proc /boot /dev /etc/fstab /etc/mtab
then, reinstall a fresh centos to erase the disk (crash simulation) and to simulate the initial restore I would do after a crash. From there, I go again with the livecd, mount r/w the logical volume, cpio -i all my files, and reboot. It sort of goes well. system reboots correctly - it loads all my drivers (even asterisk & dahdi and the T1/E1 card light goes green...), starts KDE, but from there I get an infamous error message preventing me to log in "Your session only lasted less than 10 seconds" - looking in the details, i get this message "could not exe /etc/X11/xinit/XSession default' - but I dont think X11 has so much to do with it...
When I go to a text console (ctrl alt f1), and try to log, no luck either - and no time to see why. I've modified initrd to level 1 - there I get the single user prompt, that's ok - but init 3 brings me to a screen where I cant log (either with root or a user) - there is a clear difference between an incorrect password and a failed login - the later, as soon as I enter the password, I return to a login prompt Now my questions. 1/ how can I make a "system backup" of Centos 5.3 x64 -ie after a crash, I want an image tha t I will restore and bring back OS + Applications (data can be backed up separately) 2/ what is wrong with my restore thru livecd ? why cant I log into the system ?
I clone an drive with CentOs 5.3 from a drive connected to ATA0 device 0 of an ATA controller to an identical drive connected to the same ATA contoller ATA1 device 0. No matter what I do it boots from ATA1 device 0 and I need to be able to control which one it is booted from. When I have puppy linux on one drive and CentOs on the other drive I can control the boot thru the system BIOS either way no matter if puppy is in ATA 0 or 1. So its not a BIOS issue. It appears (to me) to be a grub configuration issue. Since the 2 drives are clones they both have VolGroup00. I think grub loads from the last VolGroup00 found.
Here is my grub.conf file: # grub.conf generated by anaconda # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 # initrd /initrd-version.img # boot=/dev/hde default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-128.el5) root (hd0,0) kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-128.el5.img
Here is the Device.map: # this device map was generated by anaconda (hd0) /dev/hde
I had to reinstall 10.04 because I got an error, waiting for root device. And I figured I knew why I got this error: I changed my xconf.cfg (or whatever the file is in /etc/x11/) -- So this time I downloaded the 64 bit, because I have a 64 bit computer, so though, might as well get it! I've narrowed the problem down to this:
After I install nvidia settings (the x server or whatever?) And change my view to TwinView (I have my laptop monitor and an external monitor), and save the config file, this happens. I will do some more testing, but here is the whole error message: Gave up waiting for root device. Common problems:
- Boot args (cat /proc/cmdline) - Check rootdelay= (did the system not wait long enough?) - Check root= (did the system wait for the right device? - Missing modules (cat /proc/modules; ls /dev) ALERT! /dev/disk/by-uuid/bcb49367-8554-4116-8e4d2b39d92415cf does not exist. Dropping to a shell!
BusyBox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu11) built-in shell (ash) Enter 'help' for a list of built-in commands.
I'm running into a strange problem trying to change the service load or boot order on my CentOS 5.3 box.
The service in question is shorewall. When I go to my /etc/rc.d/rc5.d/, I notice that shorewall is listed a S27shorewall. I need it to start much later. So I run a simple command "mv S27shorewall S99shorewall"
I then restart the server. But after the reboot, something has reset it back to S27shorewall.
For those of you who like the background story: I need to change it to S99shorewall, because I need shorewall to start AFTER xend does all its stuff, as xend messes around with the underlying networking of the computer. The xend stuff was at S98 and S99...but I was able to successfully rename them back to S97 and S98, and the rename stuck. I've also renamed other service orders. Those stick. The only one that gets reset is shorewall, always back to S27. I have no clue how to tell what is causing the resetting...
This is wrong, now My audigy should be default with the UART (onboard) being secondary. I will be setting this up for my microphone / headset.Now if I restart I will get the following..
I am unable to start apache on my linux machine with following errors Starting httpd: Syntax error on line 117 of /etc/httpd/conf/httpd.conf: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration I am using CentOS5 with apache version httpd-2.2.13
I have a webserver to host some system application to the public. the server have two network interface. I set eth0 with wan IP and eth1 with internal LAN IP.the reason for the internal ip on eth1 is to enable LAN pc directly access to the webserver application..is this configuration is ok. sometimes the server link down and i have to restart network to get it back to normal again.. Is there any additional configuration in order to make the network stable.
I am having a heck of a time trying to find directions on networking my two computers together in order to share files. I have two machines running Ubuntu 10.10 Desktop & Netbook remix.
They are both connected to my wireless router to connect to the internet.
It seemed that it would be simple enough: take the 'f' option in the expert menu of fdisk to put partitions in order after a gap had been created by a deleted partition and then make corresponding changes in /boot/grub/grub.conf because the root partition was shifted.
Well, it didn't work out that way. No matter what I try, I either see the error 15 at Stage1.5 or the error 28, which is even stranger (file does not fit into memory). All this before I even see a grub menu. It just does not get that far.
Does anyone want to take as stab at guessing what might have happened here and whether I have a chance at recovering without having to reinstall? I can provide concrete data, if anyone would be kind to give it a try. Hoping that this is a known problem and something can be guessed from what I stated here but I can be as specific as needed, just don't want to generate noise if there are no takers.
I have a PHP script which will show info from 5 lines in a MySQL database, with a "next" button to show the next 5 lines and so on. Initially it'll get called with a ?page=1 in the args in the URL, and then onward I want the "next" button to link to the same script , but with a ?page=2 in the args. First of all, how can I access the "page" variable inside the script to see what args it's been given? (sorry, extremely newbie question here )
And secondly, what will the code for the "next" button look like? If the script is called "seenames.php", I want this: print "A HREF="...cgi/seenames.php?page=$page+1">Next</A> , if you get my meaning. But what will the quoting for the above line be? I'm sure I've got it wrong.
I just upgraded by box from Fedora Core 9 to Centos 5.2. Finally!I have a 500GB SATA drive, it's partitioned into three equal size slices, hda1 through 3. The old Fedora was on hda1, I installed the new Centos on hda3. I instructed the installer to write the MBR to /dev/hda, not /dev/hda3. Fdisk says I have sector 0 unused.First, the system wouldn't boot - it just looped through the BIOS, rebooting over and over again. The BIOS sees the disk, but it never loaded Grub. I tried re-running grub-install /dev/hda, and not I get a Grub Error 17 after stage 1.5 loads.
I can boot from rescue OK, the grub.conf man menu.lst look fine, it's pointing to "root (hd0,2)". It's either the BIOS that can't find the MBR, or the MBR can't find Grub.When I looked at the disk with fdisk after the install, hda1 was still marked bootable, hda3 was not, so I swapped bootable flags but that has not made a difference. I also appended the new grub to the old grub thinking I could get the MBR (if it is there) to load the old grub and thence find the new Centos, but that didn't work either.Mobo is an old Shuttle AK35.Any ideas? Did I mess up by not telling the system to put the MBR on /dev/hda3? Is there a way to fix this without reinstalling?
I've installed the CentOS 5.1 from a CD only yesterday and everything is working fine except Mysql that came from the CD distribution. I have detected that my system has mysql.
[root@onion /]# rpm -qa |grep mysql mysql-5.0.22-2.1.0.1 [root@onion /]# find . -name mysql ./usr/bin/mysql ./usr/share/mysql ./usr/lib/mysql
However I'm unable to find mysqld, safe_mysqld or mysql_install_db in my filesysytem.
Is it possible to list/find/compare the program versions on a Centos system, against Redhat/Centos Errata/Security/Bug lists? Sort of looking for a way to make sure that all the packages on a system are ok, and not a security risk-- Without having to update every package. A pseudo code, in my mind is:
where I can find a SIProxd RPM for CentOS 5.4/5.5 ? (64 bit architecture)I can't seem to find one and when I did an install from source, due to problems with libosip2, it gave me this error: [root@static-host src]# siproxd siproxd: error while loading shared libraries: libosip2.so.4: cannot open shared object file: No such file or directory