Alexei Luzan
01/15/2010 8:32 AM
post45285
|
hello.
i want to start high availability server with samba-services. so i try to test attaching smbd daemon to HAM.
i do these actions in shell:
--
QCC -l/usr/lib/libham.so addsmbd.c -o addsmbd //compiling a program for attaches smbd to HAM with simple restart smbd
if it's dead
ham //starting the HAM
./addsmbd //starting the attaching program
--
after that there is working smbd - i can see shared folders. when i slay smbd and use comand ps after that it shows me
that smbd is working - and i can see shared folders too.
but there is a some details: after attaching smbd to HAM there is 100% CPU load
comand top shows me that the most CPU resourced are taken by 3 processes "kernel" (and there are 3 "devb-eide" processes
; when i don't try to all these actions there is only one such process).
first i thought that is incorrect restart of smbd (when we are attaching smbd to ham and smbd is not started HAM starts
it), but when i tried this:
---
smbd -D
ham
./addsmbd
---
- the result was the same, 100% CPU loading :( maybe there is some error in ham_attach action?
--
source code of addsmbd.c (made form the High Availability Framework's "inetd simple restart" with ctrl+r =D ):
/* addsmbd.c */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/netmgr.h>
#include <fcntl.h>
#include "ha/ham.h"
int main(int argc, char *argv[])
{
int status;
char *smbdpath;
ham_entity_t *ehdl;
ham_condition_t *chdl;
ham_action_t *ahdl;
int smbddpid;
if (argc > 1)
smbdpath = strdup(argv[1]);
else
smbdpath = strdup("/usr/pkg/sbin/smbd -D"); /* samba was compiled from pkgsrc repository */
if (argc > 2)
smbdpid = atoi(argv[2]);
else
smbdpid = -1;
ham_connect(0);
ehdl = ham_attach("smbd", ND_LOCAL_NODE, smbdpid, smbdpath, 0);
if (ehdl != NULL)
{
chdl = ham_condition(ehdl,CONDDEATH, "death", HREARMAFTERRESTART);
if (chdl != NULL) {
ahdl = ham_action_restart(chdl, "restart", smbdpath,
HREARMAFTERRESTART);
if (ahdl == NULL)
printf("add action failed\n");
}
else
printf("add condition failed\n");
}
else
printf("add entity failed\n");
ham_disconnect(0);
exit(0);
}
----
how can i do it works normally?
thanks in advance
|
|
|