Hot answers tagged


You can look at the contents of /etc/redhat-release, which will look something like this: $ cat /etc/redhat-release CentOS release 5.4 (Final) The contents are different for an actual RHEL system. This technique works on all RedHat derivatives, including CentOS, Fedora, and others.


You can use the lsb_release command on recent linux distributions. If you issue: lsb_release -i -r it will tell you the Distribution and Version. This is a little bit more accurate than accessing files that may or may not have been modified by the admin or a software package. As well as working across multiple distros.


To be honest, I think this comes down to simple viewpoint: Chef seems more of an imperative, programmatic solution, the usage of ruby as the language instantly makes me hope somebody ported it to python, as is the way of the world with all of ruby's ideas. That's not what you want for this sort of thing though. You want to speak to the void where the ...


Modify the OPTIONS line in /etc/sysconfig/memcached adding ">> /var/log/memcached 2>&1" on the end. IE OPTIONS="-vv >> /var/log/memcached 2>&1"


I prefer to use the /etc/issue file. $ cat /etc/issue I've seen many situations where /etc/redhat-release has been modified to meet software compatibility requirements (Dell or HP's management agents, for instance).


I've written a detailed comparison of Chef vs Puppet here: Puppet vs Chef: 10 reasons why Puppet wins. Although it doesn't include use cases, I hope it provides some useful starting points for people wondering which tool to choose for their infrastructure automation.


About comparing installed kernels with running one: #!/bin/bash LAST_KERNEL=$(rpm -q --last kernel | perl -pe 's/^kernel-(\S+).*/$1/' | head -1) CURRENT_KERNEL=$(uname -r) test $LAST_KERNEL = $CURRENT_KERNEL || echo REBOOT Hope that helps!


Sorry about the verbosity. Use the tool that makes it's easy to get your job done. That's the point of automation, right? History: I have used puppet in past gigs and last month I spent about a week trying to get used to chef to see if I would make the switch at my new gig. I didn't leap. Jargon: One unfortunate problem with both of these systems is the ...


We recommend everyone run through a reinstall rather than attempt an inplace upgrade from CentOS-4 or CentOS-5! Source: You can run this upgrade centos6 just by using yum upgrade --enablerepo=centosplus. Do not forget: each system running centos is individual (!). I recommend you ...


Per my comment, I don't believe there is an equivalent to the "" central package archive (with web interface) in CentOS. It's something I think is really missing!


Add multilib_policy=best to your /etc/yum.conf Yum will now try to install the "best" package.arch for your system and it will only install that one (as long as it is available). Assuming you're on a 64-Bit system, yum will first try to install package.x86_64, if that doesn't exist it will fall back to i386 and noarch. The default setting is ...


Install the nsclient++ agent on windows, then configure your RHEL5 nagios config file accordingly. There may be other windows nagios agents, or you can configure nagios to use remote probes with SNMP, but I've used nsclient++ and it works well.


CPU utilization is measured relative to a single CPU. The maximum is 100% for each CPU, so a four-CPU system would have a maximum CPU utilization of 400%.


Try the disable repo switch: --disablerepo=REPONAME UPDATE To find all repositories currently "known" (enabled and disabled): yum repolist all Then to find which repository is giving you grief for the above package, try: yum list php53-mcrypt-5.3.3-4.ius.el5.x86_64 --showduplicates This will then show which of your repositories provide the above ...


Can I suggest an alternative solution? You might find that a configuration management tool like Puppet or Cfengine2 does what you want. You write manifest files that describe how you want a system to look and it goes away and changes the system so it looks like that. Notice the important distinction that you are describing how the system should look, not how ...


The most reliable way when lsb_release is not installed is: # rpm -q --queryformat '%{VERSION}' redhat-release-server 6Server # rpm -q --queryformat '%{RELEASE}' redhat-release-server On minimal installs, lsb_release is missing. To get this working also with Red Hat clones (credit goes to comments): # rpm -q --queryformat '%{VERSION}' $(rpm ...


This is because after a recent update to openssl on CentOS 6, openssl-1.0.1e-30.el6.11.x86_64, programs using this library started to refuse connecting to servers vulnerable to Logjam TLS vulnerability. You need to configure sendmail to use stronger temporary Diffie–Hellman key — at least 1024 bit. It is not the same key that you use in your TLS certificate,...


No, the algorithm is not that simplistic. You can find more information in: If you want to track memory usage, I'd recommend running a command like: ps -e -o pid,user,cpu,size,rss,cmd --sort -size,-rss | head It will give you a list of the processes that are using the most memory (and probably causing the OOM situation). ...


maybe something like this will help. it will block any hosts, that open more than 150 connections within 2 minutes (180 seconds): iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds 180 --hitcount 150 -j REJECT you have to tune the ...


The user ID of scan is set to 0 (root). Check if /etc/passwd contains two entries for scan. One mapped to root. Otherwise, if you are using any other name services check that these dont export scan as UID 0. And make sure you tell these people mapping multiple accounts to the same UID is not a good idea as you break the separation of privileges you would ...


From the man page:- "vgrename Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 VolGroup00_tmp" changes the name of the Volume Group with UUID Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 to "VolGroup00_tmp". for your case:- vgrename zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-2fBS87 newvolgroupname ...will rename the volume group with ID zOuHvA-QTBR-wNPs-3GIQ-b2zQ-yOeH-...


You can just su. You won't need the password because the script will initally be running as root. There's also the runuser command. If you use /etc/init.d/functions you can use the daemon function which has an option for specifying the user to run as. I'd personally sway towards the latter all other things being equal.


You can try package from ActiveState It doesn't depend on package manager (just unpack and run ""). Or you can compile Python and create package by yourself Here is how to create RPM by yourself: Here is how ...


No worries, it just executed 'rpm -e' which would not remove any package. [root@web420 ~]# rpm -e rpm: no packages given for erase BTW, for verifying you have not removed all packages you could just run rpm -qa and see the list of installed packages.


You deleted all of your users' passwords, because they aren't stored in /etc/passwd anymore like they were in the olden days. pwconv is only for converting entries from passwd to shadow and vice versa -- you should never have to use it in day-to-day tasks. Boot into single-user mode as DaveN suggested, restore the file from backup, chalk this one up to ...


First and foremost, boot off a live CD or recovery disk and back up your data. You may want to include system configurations from /etc, too. You can try doing a reinstall over what you have, leaving your partitions you want to keep untouched. As long as you weren't keeping your good data in any system partitions (and let's hope not under /usr), you should ...


Try using: tail --follow=name <logfile> And see if that works better. You don't have to worry about it being rotated out from under you. Any pattern to it stopping? Certain length of time? Certain time of day?


Assuming all the users are local users (that is, there's no network directory service like LDAP, Active Directory, NIS, etc), then local users are probably all enumerated in /etc/passwd, which is a colon delimited file with the following fields: username:password:uid:gid:name:home directory:shell You can get just the usernames and home directories, if ...


Jailkit simplifies it. Jailkit is a set of utilities to limit user accounts to specific files using chroot() and or specific commands. Setting up a chroot shell, a shell limited to some specific command, or a daemon inside a chroot jail is a lot easier and can be automated using these utilities.

Only top voted, non community-wiki answers of a minimum length are eligible