Xymon Mailing List Archive search

how to run 2 xymon-servers on 1 host?

6 messages in this thread

list Paul van Eldijk · Mon, 14 Mar 2011 17:06:21 +0100 ·
Hi,

I would like to run 2 xymon-4.3.0 servers on 1 host (one for testing, one for production), each with its own user (xymon vs xymontst) and port (1984 vs. 1985). The problem is, that I get an error-message when starting the second server:

"Could not get shm of size 262144: Permission denied"

Obviously, the second server tries to access/allocate the same shm-segment as the first one.
I'm guessing I have to change the source code somewhat, to allocate a different shm-=segment and/or semaphore, but I've got no clue as to how and where :(
(I'm no good in programming C)

Is there a way to run 2 servers on the same host as different users and if so, how?

Can someone advice me on how to do this?

regards,
Paul
list Henrik Størner · Mon, 14 Mar 2011 17:43:55 +0100 ·
quoted from Paul van Eldijk
I would like to run 2 xymon-4.3.0 servers on 1 host (one for testing,
one for production), each with its own user (xymon vs xymontst) and port
(1984 vs. 1985). The problem is, that I get an error-message when
starting the second server:

"Could not get shm of size 262144: Permission denied"
This is one of the more obscure parts of the SysV IPC specs, but it 
basically boils down to this: Make sure the two Xymon servers have 
different XYMONHOME directories, and it should work OK.

(For details, look up the documentation on your systems' "ftok" function).


Regards,
Henrik
list Stef Coene · Mon, 14 Mar 2011 20:07:21 +0100 ·
quoted from Paul van Eldijk
On Monday 14 March 2011, Paul van Eldijk wrote:
Hi,

I would like to run 2 xymon-4.3.0 servers on 1 host (one for testing,
one for production), each with its own user (xymon vs xymontst) and port
(1984 vs. 1985). The problem is, that I get an error-message when
starting the second server:

"Could not get shm of size 262144: Permission denied"

Obviously, the second server tries to access/allocate the same
shm-segment as the first one.
I'm guessing I have to change the source code somewhat, to allocate a
different shm-=segment and/or semaphore, but I've got no clue as to how
and where :(
(I'm no good in programming C)

Is there a way to run 2 servers on the same host as different users and
if so, how?

Can someone advice me on how to do this?
I do this regulary and use 2 different users.  I never got any shared memory 
problems doing so.


Stef
list Paul van Eldijk · Tue, 15 Mar 2011 09:43:22 +0100 ·
Op 14-3-2011 17:43, Henrik Størner schreef:
quoted from Stef Coene
I would like to run 2 xymon-4.3.0 servers on 1 host (one for testing,
one for production), each with its own user (xymon vs xymontst) and port
(1984 vs. 1985). The problem is, that I get an error-message when
starting the second server:

"Could not get shm of size 262144: Permission denied"
This is one of the more obscure parts of the SysV IPC specs, but it
basically boils down to this: Make sure the two Xymon servers have
different XYMONHOME directories, and it should work OK.
I must be missing something...

I've got 2 users:
uid=104(xymon) gid=501(beheer) groups=501(beheer), home directory 
(=install directory): /data/xymon

uid=105(xymontst) gid=501(beheer) groups=501(beheer), home directory: 
/data/tstxymon

Each user has a different XYMONHOME:

/data/xymon/server/etc/xymonserver.cfg:XYMONHOME="/data/xymon/server"

/data/tstxymon/server/etc/xymonserver.cfg:XYMONHOME="/data/tstxymon/server"

(For details, look up the documentation on your systems' "ftok" function).
according to the documentatiop of 'ftok' this should be working..

Wat am I missing?

BTW:
my system is a RedHat EL6 system:
Linux server 2.6.32-71.18.2.el6.x86_64 #1 SMP Wed Mar 2 14:17:40 EST 
2011 x86_64 x86_64 x86_64 GNU/Linux


Can you please advise?
Paul
-- 
så länge min chef låtsas som om jag har hög lön,
låtsas jag om jag har mycket att göra!
list Stef Coene · Tue, 15 Mar 2011 10:08:37 +0100 ·
quoted from Paul van Eldijk
On Tuesday 15 March 2011, Paul van Eldijk wrote:
Op 14-3-2011 17:43, Henrik Størner schreef:
I would like to run 2 xymon-4.3.0 servers on 1 host (one for testing,
one for production), each with its own user (xymon vs xymontst) and port
(1984 vs. 1985). The problem is, that I get an error-message when
starting the second server:
"Could not get shm of size 262144: Permission denied"
This is one of the more obscure parts of the SysV IPC specs, but it
basically boils down to this: Make sure the two Xymon servers have
different XYMONHOME directories, and it should work OK.
I must be missing something...

I've got 2 users:
uid=104(xymon) gid=501(beheer) groups=501(beheer), home directory
(=install directory): /data/xymon

uid=105(xymontst) gid=501(beheer) groups=501(beheer), home directory:
/data/tstxymon

Each user has a different XYMONHOME:

/data/xymon/server/etc/xymonserver.cfg:XYMONHOME="/data/xymon/server"

/data/tstxymon/server/etc/xymonserver.cfg:XYMONHOME="/data/tstxymon/server"
(For details, look up the documentation on your systems' "ftok"
function).
according to the documentatiop of 'ftok' this should be working..

Wat am I missing?
You can display shared memory usage with:
ipcs -m
This is normally per user, so if you use different users, it shoud work.

I had some shared memory problems before, but that was caused by using the same user.
Maybe some shared memory is locked?  You can clean it up with the ipcrm command.


Stef

This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
list Paul van Eldijk · Tue, 15 Mar 2011 10:59:02 +0100 ·
Op 15-3-2011 10:08, Stef Coene schreef:
quoted from Paul van Eldijk
On Tuesday 15 March 2011, Paul van Eldijk wrote:
Op 14-3-2011 17:43, Henrik Størner schreef:
I would like to run 2 xymon-4.3.0 servers on 1 host (one for testing,
one for production), each with its own user (xymon vs xymontst) and port
(1984 vs. 1985). The problem is, that I get an error-message when
starting the second server:

"Could not get shm of size 262144: Permission denied"
This is one of the more obscure parts of the SysV IPC specs, but it
basically boils down to this: Make sure the two Xymon servers have
different XYMONHOME directories, and it should work OK.
I must be missing something...

I've got 2 users:
uid=104(xymon) gid=501(beheer) groups=501(beheer), home directory
(=install directory): /data/xymon

uid=105(xymontst) gid=501(beheer) groups=501(beheer), home directory:
/data/tstxymon

Each user has a different XYMONHOME:

/data/xymon/server/etc/xymonserver.cfg:XYMONHOME="/data/xymon/server"

/data/tstxymon/server/etc/xymonserver.cfg:XYMONHOME="/data/tstxymon/server"
(For details, look up the documentation on your systems' "ftok"
function).
according to the documentatiop of 'ftok' this should be working..

Wat am I missing?
You can display shared memory usage with:
ipcs -m
This is normally per user, so if you use different users, it shoud work.

I had some shared memory problems before, but that was caused by using the
same user.
Maybe some shared memory is locked?  You can clean it up with the ipcrm
command.
Alas, but xymontst has no shared memory allocated:
# ipcs

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x01100008 0          xymon      600        262144     2
0x02100008 32769      xymon      600        262144     2
0x03100008 65538      xymon      600        262144     2
0x04100008 98307      xymon      600        262144     2
0x05100008 131076     xymon      600        262144     1
0x06100008 163845     xymon      600        32768      1
0x07100008 196614     xymon      600        524288     2
0x08100008 229383     xymon      600        524288     2
0x09100008 262152     xymon      600        131072     1
0x68100016 294921     zabbix     666        8421519    25
0x78100016 327690     zabbix     666        16777627   25
0x74100016 360459     zabbix     666        4194702    25
0x67100016 393228     zabbix     666        7130317    25
0x73100016 425997     zabbix     666        1258291    25

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x00000000 0          root       600        1
0x00000000 98305      root       600        1
0x00000000 229378     apache     600        1
0x00000000 851971     apache     600        1
0x00000000 884740     apache     600        1
0x01100008 393221     xymon      600        3
0x02100008 425990     xymon      600        3
0x03100008 458759     xymon      600        3
0x04100008 491528     xymon      600        3
0x05100008 524297     xymon      600        3
0x06100008 557066     xymon      600        3
0x07100008 589835     xymon      600        3
0x08100008 622604     xymon      600        3
0x09100008 655373     xymon      600        3
0x7a100016 753678     zabbix     666        7

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

So the problem must be somewhere else, I'm guessing...

Paul