Archive for the 'Linux Support' Category

SBDavid

Sharing Write Permission

Sharing Write Permission

For more than one user to be able to write to the same directory it will be necessary to grant write permission to a group they share in common. The following example grants shared write permission to /var/www to the group “webmasters”.

sudo chgrp -R webmasters /var/www
sudo find /var/www -type d -exec chmod g=rwxs “{}” \;
sudo find /var/www -type f -exec chmod g=rws “{}” \;

EXAMPLES

chgrp staff /u
Change the group of /u to “staff”.

chgrp -hR staff /u
Change the group of /u and subfiles to “staff”.

SBDavid

Super Grub2 Disk

Super Grub2 Disk

The primary purpose of Super GRUB2 Disk is to help you boot into an OS whose bootloader is broken.

Second, and almost as important, is to be a tool to learn more about GRUB2 and the booting process.

Difference between Super GRUB Disk and Super GRUB2 Disk

GRUB2 is a complete rewrite of GRUB, and Super GRUB2 Disk is a complete rewrite as well.
As Super GRUB2 Disk uses GRUB2, the differences between GRUB Legacy and GRUB2 also apply to the different versions of Super GRUB Disk.

Perhaps the most notable difference between Super GRUB Disk based on grub legacy and Super GRUB2 Disk is that Super GRUB2 Disk does not write to the disk at all, and so cannot rewrite the MBR. Super GRUB2 Disk can only be used to boot a broken system, it cannot fix it directly. Though once a system is booted, re-installing grub is usually just a matter of running “grub-install /dev/sda”.

SBDavid

Finding zombie processes

Finding zombie processes

If you have a server which is not working very well, it is possible that the process that you want to use is in a zombie state. You can see that there is a zombie process with top for example.

But with top you can’t not always see which process it is.

If we use the following command we can see which process are zombies.

ps -el | grep ‘Z’

With a normal ps -el command you see an output with in the second column the state of the process.

Here are some states:

S : sleeping
R : running
D : waiting
Z : zombie (defunct)

How to generate a crash dump on Redhat Linux

The Red Hat Crash Utility is a kernel-specific debugger. It is usually used for performing postmortem system analysis when the system panicked, locked up, or appears unresponsive.

Starting with the Red Hat Enterprise Linux 3 release, the crash utility is automatically installed during the system installation if the Development Tools package set is selected.

Test that Diskdump works. The following commands will crash your machine:

# echo 1 > /proc/sys/kernel/sysrq
# echo c > /proc/sysrq-trigger

Make sure that you run the above two commands in console (press Ctrl + Alt + F1), so that we can see what is happening when your system crashes. You have to perform this so that you can have a vmcore file to follow the rest of the paper. It will be located at /var/crash.

Display package information using rpm - RPM Package Manager

-i, –info
Display package information, including name, version, and description. This uses the –queryformat if one was specified.

-f, –file FILE
Query package owning FILE.

Description :
This package contains a system utility (passwd) which sets or changes passwords, using PAM (Pluggable Authentication Modules) library.

fedora@fedora ~> sudo rpm -qif /bin/passwd
Name : passwd
Version : 0.78.99
Release : 1.fc17
Architecture: i686
Install Date: Wed 23 May 2012 02:11:02 AM IST
Group : System Environment/Base
Size : 380177
License : BSD or GPLv2+
Signature : RSA/SHA256, Sat 28 Jan 2012 08:00:49 AM IST, Key ID 50e94c991aca3465
Source RPM : passwd-0.78.99-1.fc17.src.rpm
Build Date : Fri 27 Jan 2012 07:11:36 PM IST
Build Host : x86-07.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager : Fedora Project
Vendor : Fedora Project
URL : http://fedorahosted.org/passwd
Summary : An utility for setting or changing passwords using PAM

« Prev - Next »