Removing semaphores shared memory keys with ipcrm


IPC remove error: 


OsKey:    10101 0x00002775 Shared Memory Key: 1  remove failed **** - errno = 1 (Not owner)
OsKey:    10102 0x00002776 Shared Memory Key: 2  remove failed **** - errno = 1 (Not owner)
OsKey:    10103 0x00002777 Shared Memory Key: 3  remove failed **** - errno = 1 (Not owner)
OsKey:    10104 0x00002778 Shared Memory Key: 4  remove failed **** - errno = 1 (Not owner)
OsKey:    10106 0x0000277a Shared Memory Key: 6  remove failed **** - errno = 1 (Not owner)
OsKey:    10107 0x0000277b Shared Memory Key: 7  remove failed **** - errno = 1 (Not owner)
OsKey:    10108 0x0000277c Shared Memory Key: 8  remove failed **** - errno = 1 (Not owner)
OsKey:    10109 0x0000277d Shared Memory Key: 9  remove failed **** - errno = 1 (Not owner)
OsKey:    10110 0x0000277e Shared Memory Key: 10 remove failed **** - errno = 1 (Not owner)
OsKey:    10114 0x00002782 Shared Memory Key: 14 remove failed **** - errno = 1 (Not owner)
OsKey:    10118 0x00002786 Shared Memory Key: 18 remove failed **** - errno = 1 (Not owner)
OsKey:    10119 0x00002787 Shared Memory Key: 19 remove failed **** - errno = 1 (Not owner)
OsKey:    10130 0x00002792 Shared Memory Key: 30 remove failed **** - errno = 1 (Not owner)
OsKey:    10131 0x00002793 Shared Memory Key: 31 remove failed **** - errno = 1 (Not owner)
OsKey:    10133 0x00002795 Shared Memory Key: 33 remove failed **** - errno = 1 (Not owner)


[Thr 01] profile    /usr/sap/SID/SYS/profile/SID_SCS01_host

[Thr 01] hostname  
[Thr 01] Listen successful on port/service sapdp01
[Thr 01] EnqInitCleanupServer: Shm of enqueue table (rc = 3) does not exist, nothing to clean up[Thr 01] initialize_global: Enqueue server started WITHOUT replication functionality[Thr 01] Enqueue: EnqMemStartupAction Utc=1328995554[Thr 01] Enqueue Info: enque/use_pfclock2 = FALSE[Thr 01] *** ERROR => e=13 semop(16481,(0,-1,4096),1) (13: Permission denied) [semux_mt.c   570][Thr 01] ***LOG GEA=> SemRq( 26, 1, INFINITE_WAIT) rtc=1 [enxxmini.h   605][Thr 01] ***LOG GEI=>  [enxxmgen.h   2445][Thr 01] *** ERROR => Initialization failed. [enxxmgen.h   2445][Thr 01] *** ERROR => initialize_global: failed to initialize the enqueue table: rc=8 [enservglob.c 811][Thr 01] *** ERROR => main: Server initialisation failed!  Errortext:"error at server initialisation detected at enservglob.cpp:812 Errorinfo: "initialize_global: failed to initialize the enqueue table: rc=8"" [enservmain.c 248]


Removing semaphores shared memory keys with ipcrm

Sometimes we are not able to remove the shared memory keys with cleanipc 52 remove command, we can find the culprit this way :

ipcs | grep crdadm | awk '{printf("ipcrm -s %s\n", $2);}'

or if we already have the error like that

root@ logpipe[16010]: (start_app crd0v 52 crdadm 1): OsKey: 25238 0x00006296 Semaphore Key: 38 remove failed **** - errno = 1 (Not owner)

you may find the cultprit by

## ipcs | grep 0x00006296

it will give the ownere as well

now log in as the owner and give the command

## ipcrm -s 687 (687 is the semaphore ID)