Change Dir doubt and some advice.

Hello,

This is my first post in this forum.

I need to change the owner of several directories and files in Solaris 10 Operating system, more than 500.
The server is in production and my question is:
If i change the owner of directories and files, the server can become unstable, i mean, some services or processes can stop or don�t work properly? These change include any kind of directories and files in the server.
The owner of these directories will be root.

The advice is:
I already have a script to change the owner.

#!/bin/sh
OWNERR=root
while read direct; do
chown "$OWNERR" "$direct"
done < FileWithDir

############################
FileWithDir has the format:

/dir/dir/<file or dir>

Can someone advice any improvement in this script or that it�s not necessary.

Thanks,

Checo

Well, yes, different ownership can change access. The chown, chgrp and chmod all have a -r/-R option to do the change recursively down the sub-tree, btw. Read man chmod carefully. If a person lacks access bits as the right group or the right ID, they cannot get access from other bits.

(
 for d in $HEAD_DIRS
 do
  chown -R new_own $d &    # parallelism
 done
 
 wait
) # subshell so not to wait on any other children.

Hello DGPicket,

thanks for your answer.
I known that different ownership can change access and i know that the chown, chgrp and chmod commands have -r/-R option. I cannot use the recursevily option due that
i know exactly which directories should be changed. Change the ownership for these directories/files it's not a problem as well because the ownership which i'm changing to
it's the correct ownership for these directories/files ( I have more equal servers with the same OS and these directories/files have the same owner as the one which i'm changing to.
The main point of my question was, being this server in production, processes and services running, this change will not affect the performance of the server or
have some impact in these services/processes, taking in account that they started as a different owner. Imagine that by mistake, these directories/files were configured
with the wrong owner and now i'm changing to the correct owner. I'm sure that, if the server is restarted, these services/processes will work perfectly with this owner.

Thanks,

Checo