1827448 Members
5994 Online
109965 Solutions
New Discussion

chown shared memory?

 
Andy McDade
Advisor

chown shared memory?

Is there any way of changing the ownership of a shared memory segment? At the moment we have an application which uses a fairly large chunk of shared memory, and doesn't always get created by the right user. We have to remove the segment and reinitialise it using the correct user - if there was a utility to change the ownership that would be great.
10 REPLIES 10
Paula J Frazer-Campbell
Honored Contributor

Re: chown shared memory?

Andy

Instead of fixing the end result why not fix it at source.

Get the software guys to do the job correctly.

Paula



If you can spell SysAdmin then you is one - anon
Clemens van Everdingen
Honored Contributor

Re: chown shared memory?

Hi,

I don't believe we can chown shared memory, but why doing this ?
Solve the problem why it gets the wrong owner !
Ask the programmers to do their job. This instead of you fixing their problems.

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Andy McDade
Advisor

Re: chown shared memory?

If only I could. The developers have "many more important" things to do before getting around to this. I want to make my life easier in the (posisbly very long) meantime.
Clemens van Everdingen
Honored Contributor

Re: chown shared memory?

Hi,

As I already said, I don't think it can be done on OS level. It has to be done on program level.

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Paula J Frazer-Campbell
Honored Contributor

Re: chown shared memory?

Andy

If the ownership of this shared memory causes a problem then options:-

1. Get Dev to fix it.
2. Fix as you are doing.
3. Change user profiles/groups so that there is no ownership problem.
4. Put script in place to pick up the wrong ownership and either fix it / zap the user or send out warning.

5. Option the last - forget about it - Its Friday the sun is shining and the Pubs are open.

;^)

Paula
If you can spell SysAdmin then you is one - anon
Clemens van Everdingen
Honored Contributor

Re: chown shared memory?

Paula,

The last option is the best :-)

Clemens
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Paula J Frazer-Campbell
Honored Contributor

Re: chown shared memory?

Hi

As Andy is from the UK I thought he would appreciate that.


;^)

Paula
If you can spell SysAdmin then you is one - anon
Roger Baptiste
Honored Contributor

Re: chown shared memory?

hi,

I don't think it is possible on an existing shared memory being used. You have to do it at the source level.

HTH
raj
Take it easy.
Deepak Extross
Honored Contributor

Re: chown shared memory?

Andy,
Not sure if there's a tool out there yet, but you can roll-your-own utility to do this using shmctl().
man shmctl for details.
But as others have pointed out, this is best addressed by the developers.
Steve Lewis
Honored Contributor

Re: chown shared memory?

Why not create a new group, which the owner process/user and all attachers to the segment are a member of?

If you do ipcs -ma you see owner and group permissions listed. Surely grouping them all together will fix it.