- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: /var/adm/ files owner and group
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 04:58 AM
02-15-2005 04:58 AM
/var/adm/ files owner and group
I kind of messed up my lpsched process by changing the permissons of all files under /var/adm today:
chown -R adm:adm /var/adm/*
I fixed /var/adm/lp and my lpsched process is ok now. What I need to know is what else might I have screwed up! Looking on another box I see different files with root,bin,sys owner or group. Should I try to go though one by one and set them to the same as my other box?
I am going live on this box tomorrow and I hate for something else to be broken that I don't know about yet.
Thanks,
- Justin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 05:13 AM
02-15-2005 05:13 AM
Re: /var/adm/ files owner and group
sorry, but I think 'yes'.
There are directories like 'cron' and much log-files which belong to 'root'.
Some with 'rw----' permissions!
Also check if your command also screwed up linked files like /etc/rc.log and shutdownlog.
... sometimes a backup tape isn't so bad.
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 05:19 AM
02-15-2005 05:19 AM
Re: /var/adm/ files owner and group
- Justin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 05:31 AM
02-15-2005 05:31 AM
Re: /var/adm/ files owner and group
You can put a script for this.
Something like this.
On host where perms are OK.
find /var/adm -type f -exec ll {} \;|awk '{print $3, $4, $NF}' >> /tmp/file.list
Now on the host, you have problem.
for i in $(cat /tmp/file.list)
do
find . -type f -name $(cat /tmp/file.list|awk '{print $NF}' -exec chown "$(cat /tmp/file.list|awk '{print $1}':$(cat /tmp/file.list|awk '{print $2}'" {} \;
done
Not tested yet.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 05:33 AM
02-15-2005 05:33 AM
Re: /var/adm/ files owner and group
If you are patient you could do it by hand, but some stuff may get missed. Way back when I first started I ran a 'chown -R newuser .*' on a Solaris box. I had wanted to change all the .[a-z]* files in my home directory. I was root :( and it did change those files, but it also recursively changed '..' all the way up. I learned two valuable things;
1. be careful with wild cards, escecially when specifying '.'
2. have a good backup :)
(also only use root when required :)
I didn't have a good backup so I spent the next several hours going through all the permisions in /export/home, /export, and /. I was able to get the system in working order in the end.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 06:16 AM
02-15-2005 06:16 AM
Re: /var/adm/ files owner and group
I was just thinking of using ls -l and awk to create a script after the first reply. I do have a good system to look at.
All, thanks for everyones reply. I usally don't do silly stuff like this but I was not thinking this time.
- Justin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 07:12 AM
02-15-2005 07:12 AM
Re: /var/adm/ files owner and group
On good server do the
find /var/adm -type f -exec ll {} \;|awk '{print $3,$4,$NF}' >> /tmp/file.list
Copy the 'file.list' on the bad server and do;
-------
cat /tmp/file.list|while read own grp file
do
if [ -f $file ] #just to chk
then
ll $file #show the old
chown $own:$grp $file
ll $file # show the new
echo "" #easy to read
fi
done >> chg.log # log of chgs
--------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 08:05 PM
02-15-2005 08:05 PM
Re: /var/adm/ files owner and group
Roberts's script looks good.
I don't know what kind of backup you have.
I normally use SAM backup, so I can choose one directory to restore.
If the tape is uptodate it would be the savest solution.
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 08:21 PM
02-15-2005 08:21 PM
Re: /var/adm/ files owner and group
There is an other way.
# swlist
HPUXEng64RT B.11.00 English HP-UX 64-bit Runtime Env
# swlist -l file -a type -a mode -a owner -a group HPUXEng64RT | grep /var/adm
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2005 08:25 PM
02-15-2005 08:25 PM
Re: /var/adm/ files owner and group
How about this one
#cp /usr/newconfig/var/adm/* /var/adm