[CentOS] ls returns file doesn't exist, find finds it??
Howdy, I am getting some errors with find and ls command - such that find is able to see a file whereas ls says the file doesn't exist. Initially I was trying find and ls together as: # find ./ -type f -mtime +15 | xargs ls Similar behavior is seen even when I execute both commands separately. Any thoughts on what might be wrong here? -- thanks, neubyr ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] ls returns file doesn't exist, find finds it??
Thanks for the replies everyone. Les, you were right about meta-characters. The file name contains "double-quotes" (bad log4j config) and that's causing the problem. e.g. /opt/apps/tomcat/logs/apache.log\".-2010-09-24\" The ls command works fine after escaping double quotes: \" . My objective was to delete files matching find-pattern using 'xargs rm'. I wanted to do 'ls' before I delete these files permanently. I guess I can use 'find -delete' action instead which is working fine. -- neubyr. On Thu, Feb 24, 2011 at 7:59 AM, Les Mikesell wrote: > On 2/23/11 10:54 PM, neubyr wrote: >> Howdy, >> >> I am getting some errors with find and ls command - such that find is >> able to see a file whereas ls says the file doesn't exist. Initially I >> was trying find and ls together as: >> # find ./ -type f -mtime +15 | xargs ls >> >> Similar behavior is seen even when I execute both commands separately. >> Any thoughts on what might be wrong here? > > Can you give an example of a path that find returns and the output of > ls -l 'that_path_in_quotes' > My first guess is that you have shell metacharacters (like spaces) in the file > or directory names that the shell parses/expands if you don't quote them. > Using > the GNU --print0 extension to find and the matching -0 option to xargs might > fix it. > > -- > Les Mikesell > lesmikes...@gmail.com > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos > ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] mkswap - unable to relabel, operation not supported
Hi, I am getting following error on creating a swap fs. CentOS 5.5 {{{ mkswap: unable to relabel /srv/cloud/one/var/25/images/disk.1 to system_u:object_r:swapfile_t: Operation not supported }}} The selinux is configured in permissive mode. Any clues on what might be wrong here and how to fix it? {{{ # /bin/dd if=/dev/zero of=/srv/cloud/one/var/25/images/disk.1 bs=1 count=1 seek=512M # sudo /sbin/mkswap /srv/cloud/one/var/25/images/disk.1 Setting up swapspace version 1, size = 536866 kB mkswap: unable to relabel /srv/cloud/one/var/25/images/disk.1 to system_u:object_r:swapfile_t: Operation not supported # file /srv/cloud/one/var/25/images/disk.1 /srv/cloud/one/var/25/images/disk.1: Linux/i386 swap file (new style) 1 (4K pages) size 131071 pages }}} -- thanks, neuby.r ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] mkswap - unable to relabel, operation not supported
On Thu, Mar 10, 2011 at 3:24 PM, Daniel J Walsh wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 03/10/2011 04:02 PM, neubyr wrote: >> Hi, >> >> I am getting following error on creating a swap fs. CentOS 5.5 >> {{{ >> mkswap: unable to relabel /srv/cloud/one/var/25/images/disk.1 to >> system_u:object_r:swapfile_t: Operation not supported >> }}} >> >> The selinux is configured in permissive mode. Any clues on what might >> be wrong here and how to fix it? >> >> {{{ >> # /bin/dd if=/dev/zero of=/srv/cloud/one/var/25/images/disk.1 bs=1 >> count=1 seek=512M >> >> # sudo /sbin/mkswap /srv/cloud/one/var/25/images/disk.1 >> Setting up swapspace version 1, size = 536866 kB >> mkswap: unable to relabel /srv/cloud/one/var/25/images/disk.1 to >> system_u:object_r:swapfile_t: Operation not supported >> >> # file /srv/cloud/one/var/25/images/disk.1 >> /srv/cloud/one/var/25/images/disk.1: Linux/i386 swap file (new style) >> 1 (4K pages) size 131071 pages >> }}} >> >> -- >> thanks, >> neuby.r >> ___ >> CentOS mailing list >> CentOS@centos.org >> http://lists.centos.org/mailman/listinfo/centos > Are you doing this on an NFS partition? > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.11 (GNU/Linux) > Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk15QXwACgkQrlYvE4MpobP5VACeNEP3g4OJ0ATA040L8w78He2v > 9pkAnAuPlGSVHWPoYmIy/BAiekFgeuD+ > =1orM > -END PGP SIGNATURE- > Yup, the 'var' directory in path above is a nfs mount. Is there anyway I can enable this? Thanks, neuby.r ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] NFS still serving old directory after rename
Howdy, I have renamed a directory on NFS ver 3 server and then created a new directory again with the same name. # mv dir dir-hosed # mkdir dir The directory is auto-mounted on client side. I had unmounted directories on client side before making above changes. Now when I try to mount back 'dir', I still see old files and not new empty dir. Am I missing something here in the NFS config? Is it caching old directory contents? Any help? thanks, neuby. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] NFS still serving old directory after rename
Seems like some clients (especially new connections) are mounting the new dir correctly. Not sure what's the problem though. -- thanks, neuby. On Mon, Mar 14, 2011 at 9:49 AM, neubyr wrote: > Howdy, > > I have renamed a directory on NFS ver 3 server and then created a new > directory again with the same name. > # mv dir dir-hosed > # mkdir dir > > The directory is auto-mounted on client side. I had unmounted > directories on client side before making above changes. Now when I try > to mount back 'dir', I still see old files and not new empty dir. Am I > missing something here in the NFS config? Is it caching old directory > contents? Any help? > > thanks, > neuby. > ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] NFS still serving old directory after rename
On Mon, Mar 14, 2011 at 10:04 AM, Nico Kadel-Garcia wrote: > On Mon, Mar 14, 2011 at 10:49 AM, neubyr wrote: >> Howdy, >> >> I have renamed a directory on NFS ver 3 server and then created a new >> directory again with the same name. >> # mv dir dir-hosed >> # mkdir dir >> >> The directory is auto-mounted on client side. I had unmounted >> directories on client side before making above changes. Now when I try >> to mount back 'dir', I still see old files and not new empty dir. Am I >> missing something here in the NFS config? Is it caching old directory >> contents? Any help? > > One step at a time. Show your automount tables: are you using direct > automounting, which requires "/sbin/service autofs reload" ? Or > indirect automounting, which should just work? And when you say you > "unmounted directories on client side", how exactly did you do that? > Did you do "umount /mount/dir" and get a successful unmount? Or did > you do a naughty thing and use "umount -l", which can create chaos > without careful handling? > > If you have old software holding open the mount point, the > automounting changes *will not* overwrite the old mountpoint until > they are released properly. And it shouldn't! > Thanks for the reply Nico. I unmounted dir in a clean manner. I made sure that no other process is trying to access that mounted dir on client side. Not sure what was the problem, but it seems to be working now. I am guessing autofs or nfs had some timeout/cache settings that caused this problem initially. I will try to replicate it some time later to see what was causing it. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] figuring out LogVol details for mount
Hi, I need to mount a LVM in rescue mode to create a new initrd image. I am not sure how do I fond out which LogVol is to be mounted. How do I find it out? In most of the configs I have used LogVol00 with ext3 filesystem which contains OS install. This particular system is not installed by me and I am not sure how do I find it out. I did try 'lvm lvs' command, but probably that's not the right command here. Any help? -- thanks, neuby.r. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] figuring out LogVol details for mount
On Thu, Mar 31, 2011 at 8:39 PM, Nico Kadel-Garcia wrote: > On Thu, Mar 31, 2011 at 8:50 PM, Winter wrote: >> On 3/31/2011 6:22 PM, neubyr wrote: >>> Hi, >>> >>> I need to mount a LVM in rescue mode to create a new initrd image. I >>> am not sure how do I fond out which LogVol is to be mounted. How do I >>> find it out? In most of the configs I have used LogVol00 with ext3 >>> filesystem which contains OS install. This particular system is not >>> installed by me and I am not sure how do I find it out. I did try 'lvm >>> lvs' command, but probably that's not the right command here. Any >>> help? >>> >>> -- >>> thanks, >>> neuby.r. >> >> Good evening, Neuby >> >> When you boot into rescue mode are you given the option to >> continue-mount or read-only-mount the system to /mnt/sysimage? You >> could try to view /mnt/sysimage/etc/fstab to find the partition types. >> >> Regards, >> >> W. > > If he could do *that*, he would already have the volumes mounted, > barring other strangeness going on. They'd all be mounted under > "/mnt/sysimage", and would be revealed by the "df" or "mount" > commands. > > If this isn't available, the "pvscan", "vgscan", and "lvscan" commands > are all available in the bootable CD, *but* they are all built into > the underlying "lvm" command. So type "lvm pvscan" to find what > physical volumes are set up for LVM, "lvm vgscan" to find the volume > groups, and "lvm lvscan" to find the volumes. > > Re-activating an 'inactive' LVM due to a messed up configuration or > volume is left as an exercise for the reader. > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos > It's not mounting any volumes by default as it's not able to read partition table and hence says no Linux partitions found. But I am able to see partitions using fdisk and check LVM volumes. I am not sure which volume of that contains OS install VolGroup00-LogVol00 or VolGroup00-LogVol01. Is there any way I can determine it? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] logical volume - device present without table
I am trying to mount a logical volume for creating new initrd image. The lvs command is showing a logical volume with 'd' attribute - device present without tables. It's getting listed under /dev/mapper but not under /dev/VolGroup00. Any help on what might be wrong here? -- thanks, neuby.r ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] ruby 1.8.7 from source
I need to install ruby 1.8.7 on CentOS 5.5 x86_64 system. I am planning to install it from source, but I am not sure whether this will install rdoc, ri and ruby-devel as well. I couldn't figure it out from 'configure --help' command. Appreciate any help regarding this issue. Also, any other installation options or repository suggestions are welcome. thanks, neuby.r ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] ruby 1.8.7 from source
On Fri, May 6, 2011 at 10:08 AM, Karanbir Singh wrote: > On 05/06/2011 04:06 PM, neubyr wrote: >> I need to install ruby 1.8.7 on CentOS 5.5 x86_64 system. I am >> planning to install it from source, but I am not sure whether this >> will install rdoc, ri and ruby-devel as well. I couldn't figure it out >> from 'configure --help' command. Appreciate any help regarding this >> issue. Also, any other installation options or repository suggestions >> are welcome. > > http://centos.karan.org/el5/ruby187/ > > - KB Sweet.. thanks a lot. -neuby.r ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] xargs with max each line / argument
How do I pass xargs input one line at a time to subsequent command? For example I want to install rubygems by reading a text file as shown below, however the arguments are getting passed all at once to the 'gem install' command. I hace tried -L (max-lines) and -n (max args) options, but it didn't work. What's missing here?? Any help? $ cat gem.list.1 mkrf rake xmlparser $ awk '{ print $0 }' gem.list.1 | xargs -L 1 -0 -I name sudo gem install name ERROR: could not find gem mkrf rake xmlparser locally or in a repository thanks, neuby.r ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] xargs with max each line / argument
Thanks for the help everyone. I used awk as the gem.list file may contain version number in brackets - "rake (1.2)". I should have mentioned this before. I used 'awk $1' to get first column from each row. I liked all inputs, but I think I will try mark's awk solution here. Thanks again.. On Tue, May 17, 2011 at 8:30 AM, wrote: > Andy Holt wrote: >>> [mailto:centos-boun...@centos.org] On Behalf Of neubyr >>> >>> How do I pass xargs input one line at a time to subsequent command? >>> For example I want to install rubygems by reading a text file as shown >>> below, however the arguments are getting passed all at once to the >>> 'gem install' command. I hace tried -L (max-lines) and -n (max args) >>> options, but it didn't work. What's missing here?? Any help? >>> >>> $ cat gem.list.1 >>> mkrf >>> rake >>> xmlparser >>> >>> $ awk '{ print $0 }' gem.list.1 | xargs -L 1 -0 -I name sudo >>> gem install name >>> ERROR: could not find gem mkrf >>> rake >>> xmlparser >>> locally or in a repository > > Screw xargs. Read an awk tutorial, maybe. Learn your tools. > > awk '{name = $1; cmd = "sudo gem install " name; system( cmd);}' gem.list.1. > > mark "yes, I do do awk..." > > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos > ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] yum - package version database
When I query for installed package on the system, I get following result: # yum list installed openssl Loaded plugins: fastestmirror, tsflags, verify, versionlock Loading mirror speeds from cached hostfile Installed Packages openssl.x86_64 1.0.1e-16.el6_5.4 @updates/$releasever When I try to install already installed package (just playing with yum), I get following result: # yum install openssl Loaded plugins: fastestmirror, tsflags, verify, versionlock Loading mirror speeds from cached hostfile Setting up Install Process Package matching openssl-1.0.0-27.el6_4.2.x86_64 already installed. Checking for update. Nothing to do Note, the version reported in both commands is different. Are they referring to different rpmdb state? Appreciate any information on this discrepancy. - thanks, N ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] yum - package version database
On Thu, Apr 17, 2014 at 2:18 PM, wrote: > neubyr wrote: > > When I query for installed package on the system, I get following result: > > > > # yum list installed openssl > > Loaded plugins: fastestmirror, tsflags, verify, versionlock > > Loading mirror speeds from cached hostfile > > Installed Packages > > openssl.x86_64 > > 1.0.1e-16.el6_5.4 > > @updates/$releasever > > > > When I try to install already installed package (just playing with yum), > I > > get following result: > > > > # yum install openssl > > > Package matching openssl-1.0.0-27.el6_4.2.x86_64 already installed. > > Checking for update. > > Nothing to do > > Dumb thought: what do you get with rpm -qa | grep -i openssl > > > rpm installed query reports same as yum installed: # rpm -qa | grep -i openssl openssl-1.0.1e-16.el6_5.4.x86_64 -N ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] yum - package version database
On Thu, Apr 17, 2014 at 2:46 PM, Nicolas Thierry-Mieg < nicolas.thierry-m...@imag.fr> wrote: > On 04/17/2014 11:14 PM, neubyr wrote: > > When I query for installed package on the system, I get following result: > > > > # yum list installed openssl > > Loaded plugins: fastestmirror, tsflags, verify, versionlock > > Loading mirror speeds from cached hostfile > > Installed Packages > > openssl.x86_64 > > 1.0.1e-16.el6_5.4 > > @updates/$releasever > > > > > > When I try to install already installed package (just playing with yum), > I > > get following result: > > > > # yum install openssl > > Loaded plugins: fastestmirror, tsflags, verify, versionlock > > Loading mirror speeds from cached hostfile > > Setting up Install Process > > Package matching openssl-1.0.0-27.el6_4.2.x86_64 already installed. > > Checking for update. > > Nothing to do > > > > > > Note, the version reported in both commands is different. Are they > > referring to different rpmdb state? Appreciate any information on this > > discrepancy. > > mis-configured yum repos? 1.0.0-27.el6_4.2 is an old version from 6.4 I > think. Maybe you have 6.4 hard-coded in your repo file? > > yum install should say: > Package openssl-1.0.1e-16.el6_5.7.x86_64 already installed and latest > version > > BTW your installed version is not up to date and I think it's a > heartbleed-affected version... Thanks Nicolas! It was misconfigured repo. Local repository mirror wasn't setup properly (default changed from 6.5 to 6.4!!) and hence it resulted in some conflicts. -N ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos