Operating System - HP-UX
1752623 Members
4213 Online
108788 Solutions
New Discussion юеВ

Re: List of common mistakes

 
SOLVED
Go to solution
sombriks
Advisor

Re: List of common mistakes

name resolution,

sometimes due the nature of your network a misconfigured /etc/nsswitch.conf can give you many timeouts.
Mike Miller_8
Regular Advisor

Re: List of common mistakes

Create an ignite tape and verify that you have a good backup before you make any major change.
butti
Frequent Advisor

Re: List of common mistakes

Hi,

i'm using cfg2html once a month for all server, and archive the output.

So that i could see any changes.

best regards,
butti
S. Ney
Trusted Contributor

Re: List of common mistakes

A few of mine:
If inexperienced read up on the subject. I regularly peruse through the forums and if I see something of use or interest I copy the information into a document or bookmark the page. I spent a lot of time just reading threads here and pdf documents provided by HP as well as using google.

Create a regular user with permission to su to root. Only su when doing tasks that require root access. With SAM and SMH you can give regular users special permissions to use those utilities. (For example look up restricted SAM)

On that note configure and tweak as necessary your sudoers file. Use visudo to edit. Create a root users group and groupadd your user profile to this group.

It's helpful to set your PS1 to know which server you are logged into. We have this set in /etc/profile:
PS1="$LOGNAME"@`hostname`:'$PWD'"> "
export PS1

Before doing any work create a maintenance log. I use excel to list out the tasks I am going to do in descending order with additional columns for start and end time. In other words have a plan of action.

Make sure you have some backup method in place before doing any major system work like patches, volume group work, etc.

Be very careful with the rm command. Be very careful with vgexport command as well.

Schedule your maintenance for off hours. Be aware you are creating additional IO with each patch install, lvextend, etc. If possible test the commands and actions on a non-prod server.

Read the patch requirements. Some patches require a system reboot, others do not. A lot of patches have dependencies.

As suggested above create a script so you can review work that was done. For example everytime I had to extend a lvol, add a disk, etc. I'd create a script in /tmp. (script /tmp/scriptname) It was especially helpful to review. Name your script something useful.
Manoj1
Advisor

Re: List of common mistakes

How does below commands work as root user ?
Which one is dangerous and never be used and why ?

cd /home/sun/moon/mercury/

#/home/sun/moon/mercury/> rm -rf ../*

#/home/sun/moon/mercury/> rm -rf ../*.*

#/home/sun/moon/mercury/> rm -rf *

Thanks,
Manoj


Bijeesh
Respected Contributor

Re: List of common mistakes

Hi,
#/home/sun/moon/mercury/> rm -rf ../*
Delete all the file and dirs under moon directory.

#/home/sun/moon/mercury/> rm -rf ../*.*
Delete the files and dirs which have a dot symbol and under moon directory.

#/home/sun/moon/mercury/> rm -rf *

Delete all the files and dirs under mercury directory.
Bijeesh
Respected Contributor

Re: List of common mistakes

>>List of common mistakes<<
1)Like RK mentioned in second part, same type of problem happens while copy paste the commands using mouse on PUTTY session.
The left button selected words get copied in buffer and at any time if you press the left button it pasted on the screen.So be alert while selecting the words/commands using mouse on PUTTY terminal.
2)Read the man page to avoid confusing options with commands.
shrady
Advisor

Re: List of common mistakes

Editing a file without taking backup of it and then realising that u need to revert it back.
Always keep a backup of the file u edit.
If you think "you can", you can; if you think "you can't", think AGAIN
Matti_Kurkela
Honored Contributor

Re: List of common mistakes

#/home/sun/moon/mercury/> rm -rf ../*.*
> Delete the files and dirs which have a dot symbol and under moon directory.

This answer indicates you didn't understand the danger of this command.

Remember that every directory has two special sub-directory entries: "." and "..".

This command will delete /home/sun/moon/*.*, which includes:
/home/sun/moon/.. = /home/sun/
/home/sun/moon/../.. = /home
/home/sun/moon/../../.. = /

And when "rm -rf" deletes a directory, it will also delete all files and sub-directories in it...

In other words, this command will delete *EVERY FILE AND DIRECTORY ON THE SYSTEM*.

MK
MK
Nirmal G
Advisor

Re: List of common mistakes

Hi All,

When changing the root password, kindly make sure the passwd is working/changed properly by taking a separate session before logging out the session.

This practice will be keep us tension free on root passwd issues.

Regards,
Nirmal G