/dev/null not writable

Hi,

after a server (solaris 10) got rebooted, Im faced with the problem that in one of my zones (whole zone) /dev/null is only writeable for root

crw-r--r--   1 root     sys       13,  2 Jul  8 10:16 /dev/null

Unfortunatly chmod didnt help at this point and since its a productive system I dont really feel like removing and trying to recreate it, unless Im sure it will solve my problem.

Thanks for thoughts!

Please clarify: "chmod didnt help at this point".

you have to do this as root:

chmod 0666 /dev/null

@Corona688: you can't do that in a non global zone as /dev is strictly mounted read only.
@bin-doph: did you try chmod'ing in the zoneroot dev directory from the global zone ?

Hi everybody,

thanks for all the answers. I did try to chmod the device from the zone and from the global zone, almost without success. However, today I discovered that chmoding did work, but not for very long.

bash-3.00# chmod go+w /dev/null; ls -lah /dev/null
crw-rw-rw-   1 root     sys       13,  2 Jul 11 15:01 /dev/null
bash-3.00# ls -lah /dev/null
crw-r--r--   1 root     sys       13,  2 Jul 11 15:01 /dev/null

Between those two commands is a time-delta of me pasting the second command into the shell. I've tried to figure out what process does the permission-changes on the device, but so far without success. I hardly doubt there is a custom-script with the purpose of chmoding /dev/null, at least as far as I know...

Neither the global zone nor the non global zone /dev/null change attempts will help.

As I already wrote, you need to modify the <zoneroot>/dev/null file from the global zone with zoneroot being the directory where your zone is installed.

Sorry, maybe I was unclear on that point. I did the chmod on the /dev/null file of the zone from inside the global zone. The /dev/null file of the global zone itself got the right permissions and is a link to the pseudo device file. However, the file of the zone keeps getting its permissions changed back to the wrong state right away and I'm pretty positive that it's not something 'homemade' (like a users script), just havn't figured out yet where to search for the source.

Just to be sure, please post the full path of the /dev/null file you modified.

bash-3.00# ls -l /export/zones/${ZONE_NAME}/root/dev/null /dev/null /devices/pseudo/mm\@0\:null
lrwxrwxrwx   1 root     other         27 Apr 19  2010 /dev/null -> ../devices/pseudo/mm@0:null
crw-rw-rw-   1 root     sys       13,  2 Jul 13 09:31 /devices/pseudo/mm@0:null
crw-r--r--   1 root     sys       13,  2 Jul 11 14:13 /export/zones/${ZONE_NAME}/root/dev/null

I replaced the zones name with ${ZONE_NAME} ... obviously :wink:

That's what I guessed. You misunderstood my reply.

I suggested to set the permissions on <zoneroot>/dev/null but you tried to change <zoneroot>/root/dev/null.

In our setup the "/export/zones/${ZONE_NAME}/root" directory is the root directory of the zone, what you call <zoneroot>. There is no "/export/zones/${ZONE_NAME}/dev/null", the path I posted previously resembles the /dev/null device of the zone from the global zones perspective.

Okay, what I called zoneroot is what is documented as zonepath.
What Solaris release are you using ?

cat /etc/release

What says

zonecfg -z $ZONE_NAME export
ls -l /export/zones/$ZONE_NAME
mount | grep $ZONE_NAME

?