Shared memory segments are not removed with the onmode -ky command
Posted in 2020
SangGyu Jeong found shared memory not removed by onmode -ky on an AIX instance copied via tar, causing shmget EEXIST on restart; running as root or onclean cleared it. Milan Rafaj pointed to IT29597 (INFORMIXSERVER differing between start and stop). Casey Tan said oninit/onmode/onstat ownership and permissions may be wrong after tar and suggested reinstalling; Paul Watson suggested the runasroot script. Unresolved.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: Server Administration, Platform-Specific Issues
Hello everyone.
I would like to ask for advice on the problem of restarting after stopping Informix.
Below is the order in which the instances were created.
1. Compress the entire Informix directory $INFORMIXDIR of the existing host (host1) with tar
2. Copy the tar file to another host (host_dev)
3. Uncompress tar file and start instance (-ivy)
The start of the newly configured instance on host_dev worked well, but when I restarted again after shutting down with onmode -ky command, shmget: [EEXIST][17] error message occurred. Checking with the ipcs command, the shared memory segment was not removed. It was removed with the onclean command.
Interestingly, running the onmode -ky command as the root user removed the shared memory segment.
It is being used in an AIX environment and the informix user ID (uid) and group ID (gid) are the same.
The authority of the /INFORMIXTMP directory is informix:informix. There are no other instances with the same SERVERNUM.
What else should I check?
------------------------------
SangGyu Jeong
Software Engineer
Infrasoft
Seoul Korea, Republic of
------------------------------
#Informix
Hello, It can be this issue? IT29597: shutting down an instance using INFORMIXSERVER different from the one used for startup would leave shared memory segments behind For AIX, it should be fixed in 14.10.FC3X1 12.10.FC13XF 12.10.FC13XH ------------------------------ Milan Rafaj ------------------------------
Did you tar/untar as root ? Cheers Paul
Milan - thanks for sharing this. I have run into this issue when Informix is started with INFORMIXSERVER set to a SHM connection, and then I stop it with INFORMIXSERVER set to a network connection. I don't know if this is the same issue that SangGyu is facing but I'm glad to know that there's a fix for this, and it is easy to verify if this is the problem by just switching INFORMIXSERVER when shutting Informix down. ------------------------------ Mike Walker ------------------------------
Check the owership of oninit, onstat, onmode. It could have been changed during tar/untar if you did not use root.
-rwsr-sr-- 1 root informix 27392099 Jun 12 2019 oninit
-rwsr-sr-x 1 root informix 2430365 Jun 12 2019 onmode
-rwxr-sr-x 1 informix informix 6512735 Jun 12 2019 onstat
Below are the correct permission for the 3 files.
egrep "oninit|onmode|onstat" IIFfiles
bin/onstat informix informix 2755 BRAND VRSN - IDS-CORE
bin/oninit root informix 6754 BRAND VRSN - IDS-CORE
bin/onmode root informix 6755 BRAND VRSN - IDS-CORE
------------------------------
Casey Tan
------------------------------
Hi Milan. Thank you for sharing information about the defect IT29597. I'll try the workaround of the document. ------------------------------ SangGyu Jeong Software Engineer Infrasoft Seoul Korea, Republic of ------------------------------
Hello Casey, Thanks for your reply.
I also tried running the ifmx_security.sh script to modify the permissions of files such as onmode. I don't know if that's the right way ;)
The only way to restore the permissions of Informix installation is to unzip the existing tar file or reinstall the product?
------------------------------
SangGyu Jeong
Software Engineer
Infrasoft
Seoul Korea, Republic of
------------------------------
Thanks for your reply, Paul. I ran tar/untar as the root user and checked the permissions of each file. ------------------------------ SangGyu Jeong Software Engineer Infrasoft Seoul Korea, Republic of ------------------------------
If the permissions of the 3 main files are incorrect, likely that other files needed to be fixed as well. The best method is to run ids_install installation again. ifx_security.sh script does not fix all the file permissions. Another way to try is to tar again on the source. Check if the host1 source directory $INFORMIXDIR/bin has the correct permissions, if they are correct, make sure you use the option to preserve the file permission. I do not have access to an AIX machine to test, so not too sure whether it would work well with the AIX tar -p option. ------------------------------ Casey Tan ------------------------------
To fix the perms then run the runasroot script (if you have it) Cheers Paul