mt_shm_init: can't create resident segment
Posted in 2003
A user's Informix server wouldn't restart after a shutdown/reboot, logging "shmget: [EEXIST] key 52574801: shared memory already exists / mt_shm_init: can't create resident segment" (service error 2140). Replies explained that stale shared memory segments from the old instance are blocking startup: try 'onmode -ky' first, then identify the instance's segments with 'ipcs -mo' (or 'onstat -g seg') and remove them with 'ipcrm'; rebooting the machine is the last resort. Segment keys start at 0x5256xxxx plus SERVERNUM (in hex, so care is needed above 7); a Perl script was posted to map segments to SERVERNUM automatically. The original poster didn't confirm the outcome.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
Somebody shut down my Informix server today and when I rebooted the computer the server did not start automatically when I entered services in control pane. I was getting error 2140. When I opened the server log file I got the following entry at the end of the logfile: 17:07:55 shmget: [EEXIST][17]: key 52574801: shared memory already exists 17:07:55 mt_shm_init: can't create resident segment How do I get around this?
> Somebody shut down my Informix server today and when I rebooted the > computer the server did not start automatically when I entered services in > control pane. I was getting error 2140. > When I opened the > server log file I got the following entry at the end of the logfile: > > 17:07:55 shmget: [EEXIST][17]: key 52574801: shared memory already exists > 17:07:55 mt_shm_init: can't create resident segment > > How do I get around this? reboot the unix server
First try issuing onmode -ky. Even if the server is down, this sometimes
resolves problem.
Next try ipcs -mo, then ipcrm <mem seg> for you particular instance.
Lastly....REBOOT...
Good Luck,
Wayne
-----Original Message-----
From: rastislav.j.... [mailto:rastislav.janac@dignitas.sk]
Sent: Tuesday, April 15, 2003 2:02 PM
To: ids@iiug.org
Subject: Re: mt_shm_init: can't create resident segment [932]
> Somebody shut down my Informix server today and when I rebooted the
> computer the server did not start automatically when I entered services in
> control pane. I was getting error 2140.
> When I opened the
> server log file I got the following entry at the end of the logfile:
>
> 17:07:55 shmget: [EEXIST][17]: key 52574801: shared memory already exists
> 17:07:55 mt_shm_init: can't create resident segment
>
> How do I get around this?
reboot the unix server
----LNX_Wed_Apr_16_2003_08:39:34_V3.33--
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
>Datum: 2003.04.15 21:51:00
>Sender: Zablatzky, .... <wzablatz@ubspw.com>
>
>First try issuing onmode -ky. Even if the server is down, this sometime=
s
>resolves problem.
>Next try ipcs -mo, then ipcrm <mem seg> for you particular instance.
>Lastly....REBOOT...
>
>Good Luck,
>Wayne
=
FIRST I hopefully try onstat -g seg to get some information abou=
t the
shared memory segments of the server (sometimes it works , sometimes not)=
=2E
But it makes me feel better when it is necessary to issue ipcrmcommand=
s,
especially if you have more IDS instances running on one server.
=
Regards,
Andreas Kutsche
=
------------------------------------------------
SPAR Oesterreichische Warenhandels-AG
Hauptzentrale
Europastra=DFe 3
A-5015 Salzburg
=
Telefon : +43 662 4470 24423
E-Mail : Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
------------------------------------------------
=
----LNX_Wed_Apr_16_2003_08:39:34_V3.33----
It is rather simple to determine which segments belongs to an instance.
I have 2 instances. In the onconfig file the SERVERNUM is defined a 1 and 2
respectfully.
I then issue ipcs -mo | grep informix
m 786433 0x52574801 --rw-rw---- root informix 16
m 917506 0x52584804 --rw-rw-rw- root informix 18
m 917523 0x52574803 --rw-rw-rw- informix informix 24
m 3670037 0x52584801 --rw-rw---- root informix 16
m 1572891 0x52584803 --rw-rw-rw- informix informix 16
m 1572897 0x52584802 --rw-rw---- root informix 16
m 655396 0x52574802 --rw-rw---- root informix 16
m 655398 0x52584805 --rw-rw-rw- informix informix 21
Informix addresses start at 0x5256xxxx. You just add the SERVERNUM to 5256
and you will know what segments belong to the individual instances. In my
case, 5257 belongs to SERVERNUM 1 and 5258 belongs to SERVERNUM 2.
Hope this helps.
Wayne
-----Original Message-----
From: Andreas.KUTSCHE@spar.at [mailto:Andreas.KUTSCHE@spar.at]
Sent: Wednesday, April 16, 2003 2:40 AM
To: Zablatzky, Wayne; ids@iiug.org
Subject: Antw: RE: mt_shm_init: can't create resident segment [933]
>Datum: 2003.04.15 21:51:00
>Sender: Zablatzky, .... <wzablatz@ubspw.com>
>
>First try issuing onmode -ky. Even if the server is down, this sometimes
>resolves problem.
>Next try ipcs -mo, then ipcrm <mem seg> for you particular instance.
>Lastly....REBOOT...
>
>Good Luck,
>Wayne
FIRST I hopefully try onstat -g seg to get some information about
the
shared memory segments of the server (sometimes it works , sometimes not).
But it makes me feel better when it is necessary to issue ipcrmcommands,
especially if you have more IDS instances running on one server.
Regards,
Andreas Kutsche
------------------------------------------------
SPAR Oesterreichische Warenhandels-AG
Hauptzentrale
Europastraße 3
A-5015 Salzburg
Telefon : +43 662 4470 24423
E-Mail : Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
------------------------------------------------
hex
5256xxxx = servernum of 0
hex 5257xxxx = servernum of 1 etc...
-----Original Message-----
From: Zablatzky, .... [mailto:wzablatz@ubspw.com]
Sent: Wednesday, April 16, 2003 8:00 AM
To: ids@iiug.org
Subject: RE: Antw: RE: mt_shm_init: can't create resident segment [940]
It is rather simple to determine which segments belongs to an instance.
I have 2 instances. In the onconfig file the SERVERNUM is defined a 1 and 2
respectfully.
I then issue ipcs -mo | grep informix
m 786433 0x52574801 --rw-rw---- root informix 16
m 917506 0x52584804 --rw-rw-rw- root informix 18
m 917523 0x52574803 --rw-rw-rw- informix informix 24
m 3670037 0x52584801 --rw-rw---- root informix 16
m 1572891 0x52584803 --rw-rw-rw- informix informix 16
m 1572897 0x52584802 --rw-rw---- root informix 16
m 655396 0x52574802 --rw-rw---- root informix 16
m 655398 0x52584805 --rw-rw-rw- informix informix 21
Informix addresses start at 0x5256xxxx. You just add the SERVERNUM to 5256
and you will know what segments belong to the individual instances. In my
case, 5257 belongs to SERVERNUM 1 and 5258 belongs to SERVERNUM 2.
Hope this helps.
Wayne
-----Original Message-----
From: Andreas.KUTSCHE@spar.at [mailto:Andreas.KUTSCHE@spar.at]
Sent: Wednesday, April 16, 2003 2:40 AM
To: Zablatzky, Wayne; ids@iiug.org
Subject: Antw: RE: mt_shm_init: can't create resident segment [933]
>Datum: 2003.04.15 21:51:00
>Sender: Zablatzky, .... <wzablatz@ubspw.com>
>
>First try issuing onmode -ky. Even if the server is down, this sometimes
>resolves problem.
>Next try ipcs -mo, then ipcrm <mem seg> for you particular instance.
>Lastly....REBOOT...
>
>Good Luck,
>Wayne
FIRST I hopefully try onstat -g seg to get some information about
the
shared memory segments of the server (sometimes it works , sometimes not).
But it makes me feel better when it is necessary to issue ipcrmcommands,
especially if you have more IDS instances running on one server.
Regards,
Andreas Kutsche
------------------------------------------------
SPAR Oesterreichische Warenhandels-AG
Hauptzentrale
Europastra?e 3
A-5015 Salzburg
Telefon : +43 662 4470 24423
E-Mail : Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
------------------------------------------------
That only works for Servers numbered 0-7. You need to convert to
hexidecimal for higher number servers.
"Zablatzky,
...." To: ids@iiug.org
<wzablatz@ubspw cc:
.com> Subject: RE: Antw: RE: mt_shm_init: can't create resident
Sent by: segment [940]
forum.subscribe
r@iiug.org
04/16/2003
09:00 AM
It is rather simple to determine which segments belongs to an instance.
I have 2 instances. In the onconfig file the SERVERNUM is defined a 1 and 2
respectfully.
I then issue ipcs -mo | grep informix
m 786433 0x52574801 --rw-rw---- root informix 16
m 917506 0x52584804 --rw-rw-rw- root informix 18
m 917523 0x52574803 --rw-rw-rw- informix informix 24
m 3670037 0x52584801 --rw-rw---- root informix 16
m 1572891 0x52584803 --rw-rw-rw- informix informix 16
m 1572897 0x52584802 --rw-rw---- root informix 16
m 655396 0x52574802 --rw-rw---- root informix 16
m 655398 0x52584805 --rw-rw-rw- informix informix 21
Informix addresses start at 0x5256xxxx. You just add the SERVERNUM to 5256
and you will know what segments belong to the individual instances. In my
case, 5257 belongs to SERVERNUM 1 and 5258 belongs to SERVERNUM 2.
Hope this helps.
Wayne
-----Original Message-----
From: Andreas.KUTSCHE@spar.at [mailto:Andreas.KUTSCHE@spar.at]
Sent: Wednesday, April 16, 2003 2:40 AM
To: Zablatzky, Wayne; ids@iiug.org
Subject: Antw: RE: mt_shm_init: can't create resident segment [933]
>Datum: 2003.04.15 21:51:00
>Sender: Zablatzky, .... <wzablatz@ubspw.com>
>
>First try issuing onmode -ky. Even if the server is down, this sometimes
>resolves problem.
>Next try ipcs -mo, then ipcrm <mem seg> for you particular instance.
>Lastly....REBOOT...
>
>Good Luck,
>Wayne
FIRST I hopefully try onstat -g seg to get some information about
the
shared memory segments of the server (sometimes it works , sometimes not).
But it makes me feel better when it is necessary to issue ipcrmcommands,
especially if you have more IDS instances running on one server.
Regards,
Andreas Kutsche
------------------------------------------------
SPAR Oesterreichische Warenhandels-AG
Hauptzentrale
Europastraße 3
A-5015 Salzburg
Telefon : +43 662 4470 24423
E-Mail : Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
------------------------------------------------
Hi,
below is a small Perl program that utilizes system utility "ipcs -m"
to find all SHM segments that belong to a certain IDS instance
(i.e. have a certain SERVERNUM).
With a little modification [ I leave that to you ... :) ]
the program can simply print out for each SHM segment listed
by "ipcs -m" to which SERVERNUM (and with that to which IDS
instance) it belongs.
At least it should give you an idea how to do it ...
Note 1:
The program is somewhat platform independent in that
it scans the output of "ipcs -m" for the "KEY" and "ID" columns
(which have different positions on different platforms).
In case you have a platform where the column header has a name
different from "key", "KEY" or "id", "ID" etc. then you may need to
apply some specific change there as well ...
Note 2:
The program will not work properly for systems where XPS is
running. This is because with XPS the algorithm for converting
SERVERNUM to the SHMkey is different. Therefore the program
will show a wrong SERVERNUM for SHM segments that belong
to an XPS instance.
#!/usr/local/bin/perl
#
# onbar-getshm.pl : get list of SHM segment ids of running IDS
# get SERVERNUM
$servernum = -1;
foreach $_ (`onstat -c`) {
@fields = split;
if ($fields[0] =~ /SERVERNUM/) {
$servernum = $fields[1];
}
}
# print "$servernum\\
";
$key_col = -1; # column number of key values
$id_col = -1; # column number of id values
$servnum = -1;
foreach $_ (`ipcs -m`) {
@fields = split;
if (/[kK][eE][yY]/) {
# header line, figure out column numbers
if ($fields[0] =~ /[kK][eE][yY]/) { $key_col = 0 ; }
if ($fields[1] =~ /[kK][eE][yY]/) { $key_col = 1 ; }
if ($fields[2] =~ /[kK][eE][yY]/) { $key_col = 2 ; }
if ($fields[3] =~ /[kK][eE][yY]/) { $key_col = 3 ; }
if ($fields[0] =~ /[iI][dD]/) { $id_col = 0 ; }
if ($fields[1] =~ /[iI][dD]/) { $id_col = 1 ; }
if ($fields[2] =~ /[iI][dD]/) { $id_col = 2 ; }
if ($fields[3] =~ /[iI][dD]/) { $id_col = 3 ; }
}
else {
if ($fields[$key_col] =~ /^0x/) {
# line with SHM ID and KEY
$servnum = int ( ( (oct $fields[$key_col]) - 1381386241 ) / 65536 );
# print "$servnum $fields[$id_col] $fields[$key_col]\\
";
if ($servnum == $servernum) {
print "$fields[$id_col]\\
";
}
}
}
}
exit;
Regards,
Martin
--
Martin Fuerderer
IBM Informix Development Munich
Data Management Solutions
bleb@harland.net
Sent by: forum.subscriber@iiug.org
16.04.2003 16:59
To: ids@iiug.org
cc:
Subject: RE: Antw: RE: mt_shm_init: can't create resident segment [944]
That only works for Servers numbered 0-7. You need to convert to
hexidecimal for higher number servers.
"Zablatzky,
...." To: ids@iiug.org
<wzablatz@ubspw cc:
.com> Subject: RE: Antw: RE:
mt_shm_init: can't create resident
Sent by: segment [940]
forum.subscribe
r@iiug.org
04/16/2003
09:00 AM
It is rather simple to determine which segments belongs to an instance.
I have 2 instances. In the onconfig file the SERVERNUM is defined a 1 and
2
respectfully.
I then issue ipcs -mo | grep informix
m 786433 0x52574801 --rw-rw---- root informix 16
m 917506 0x52584804 --rw-rw-rw- root informix 18
m 917523 0x52574803 --rw-rw-rw- informix informix 24
m 3670037 0x52584801 --rw-rw---- root informix 16
m 1572891 0x52584803 --rw-rw-rw- informix informix 16
m 1572897 0x52584802 --rw-rw---- root informix 16
m 655396 0x52574802 --rw-rw---- root informix 16
m 655398 0x52584805 --rw-rw-rw- informix informix 21
Informix addresses start at 0x5256xxxx. You just add the SERVERNUM to
5256
and you will know what segments belong to the individual instances. In my
case, 5257 belongs to SERVERNUM 1 and 5258 belongs to SERVERNUM 2.
Hope this helps.
Wayne
-----Original Message-----
From: Andreas.KUTSCHE@spar.at [mailto:Andreas.KUTSCHE@spar.at]
Sent: Wednesday, April 16, 2003 2:40 AM
To: Zablatzky, Wayne; ids@iiug.org
Subject: Antw: RE: mt_shm_init: can't create resident segment [933]
>Datum: 2003.04.15 21:51:00
>Sender: Zablatzky, .... <wzablatz@ubspw.com>
>
>First try issuing onmode -ky. Even if the server is down, this sometimes
>resolves problem.
>Next try ipcs -mo, then ipcrm <mem seg> for you particular instance.
>Lastly....REBOOT...
>
>Good Luck,
>Wayne
FIRST I hopefully try onstat -g seg to get some information about
the
shared memory segments of the server (sometimes it works , sometimes not).
But it makes me feel better when it is necessary to issue ipcrmcommands,
especially if you have more IDS instances running on one server.
Regards,
Andreas Kutsche
------------------------------------------------
SPAR Oesterreichische Warenhandels-AG
Hauptzentrale
Europastraße 3
A-5015 Salzburg
Telefon : +43 662 4470 24423
E-Mail : Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
------------------------------------------------
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g