[rhn-users] DRAC port to RedHat AS 4.0

Bill Watson bill at magicdigits.com
Thu Jul 20 16:10:59 UTC 2006


I am attempting to install drac (email tool, not controller card) on RedHat
AS 4.0. 

I have much of this package deployed, but am obviously missing something
since it does everything but work. Accessing port 110 (login+password) or
(get pop3 email) does not add any entry to /etc/mail/dracd.db for me.

Have you been there/done that? I think I'm stuck.  Dialog follows......

-Bill Watson
bill at magicdigits.com

I started with drac.tar.Z from ftp://ftp.cc.umanitoba.ca/src/drac.tar.Z

I uncompressed and extracted the files.

I modified Makefile as listed at the bottom of this email

I did make, make install, make install-man

I found and modified /etc/rc.d/init.d/S99drac as listed at the bottom of
this email & linked to rc2.d & rc5.d

I modified /etc/mail/sendmail as shown at the bottom of this email

I modified /usr/share/sendmail-cf/m4/proto.m4 as shown below

I added /etc/mail/dracd.allow (though since my SMTP and POP are on the same
server, it shouldn't be req'd) as shown below

I reassembled sendmail and launched the dracd daemon (a number of times)

[root at helmethouse mail]# ps aux|grep drac
root     29354  0.0  0.0  2668  716 ?        S    08:26   0:00 rpc.dracd
root       698  0.0  0.0  5592  660 pts/2    S+   08:58   0:00 grep drac
[root at helmethouse mail]#

The dracd.db seems to start up fine:
[root at helmethouse mail]# db_dump /etc/mail/dracd.db
VERSION=3
format=bytevalue
type=btree
db_pagesize=512
HEADER=END
DATA=END
[root at helmethouse mail]#

Testing seems to operate properly:
[root at helmethouse drac]# ./testing localhost 123.45.67.89
[root at helmethouse drac]# ./testing 50.0.0.198 12.34.56.78
[root at helmethouse drac]# db_dump /etc/mail/dracd.db
VERSION=3
format=bytevalue
type=btree
db_pagesize=512
HEADER=END
 31322e33342e35362e3738
 31313533343133313037
 3132332e34352e36372e3839
 31313533343133303930
DATA=END
[root at helmethouse drac]#

----------------------------------------------------------------------------
---

Makefile:
[root at helmethouse drac]# cat Makefile
        INSTALL = install
        EBIN = /usr/local/sbin
        MAN = /usr/local/man/man
        DEFS = -DSOCK_RPC -DFCNTL_LOCK -DGETHOST -DDASH_C
     #CC = <your compiler>
        RANLIB = :
        CFLAGS = $(DEFS) -g
        LDLIBS = -ldb
        TSTLIBS = -L. -ldrac
        RPCGENFLAGS = -C -I
        MANLIB = 1
        MANADM = 8
#### Makefile for drac

## Tuneables

# Paths

#INSTALL = /usr/ucb/install
#EBIN = /usr/local/sbin
#MAN = /usr/local/man/man

# OS-Dependant settings

# Choose one of this pair...
# -DTI_RPC      # Transport-independant RPC
# -DSOCK_RPC    # Socket RPC

# Choose one of this pair...
# -DFCNTL_LOCK  # fcntl() locking
# -DFLOCK_LOCK  # flock() locking

# Choose one of this pair...
# -DSYSINFO     # hostname from sysinfo()
# -DGETHOST     # hostname from gethostname()

# If rpcgen -C is specified below...
# -DDASH_C      # ANSI-C mode

# Settings for postfix and exim

# Do not set these for sendmail
# -DREQ_HASH    # requires hash format
# -DCIDR_KEY    # keys in CIDR format
# -DTERM_KD     # keys and data nul-terminated

#DEFS = -DTI_RPC -DFCNTL_LOCK -DSYSINFO

# Compiler flags
CC = cc
#RANLIB = :
#CFLAGS = $(DEFS) -g -I/usr/local/src/db/db-4.1.25/build_unix
#CFLAGS = $(DEFS) -g -I/usr/local/src/db/db-3.1.17/build_unix
#CFLAGS = $(DEFS) -g -I/usr/local/src/db/db-2.4.14/Unix
#CFLAGS = $(DEFS) -g -I/usr/local/src/db/db.1.85/PORT/sunos.5.2/include
#LDLIBS = -L/usr/local/src/db/db-4.1.25/build_unix -lnsl -ldb-4.1
#LDLIBS = -L/usr/local/src/db/db-3.1.17/build_unix -lnsl -ldb
#LDLIBS = -L/usr/local/src/db/db-2.4.14/Unix -lnsl -ldb
#LDLIBS = -L/usr/local/src/db/db.1.85/PORT/sunos.5.2 -lnsl -ldb
#TSTLIBS = -L. -ldrac -lnsl
#RPCGENFLAGS =
#RPCGENFLAGS = -C

# Man sections
#MANLIB = 3
#MANADM = 1m

## Nothing to change after this point

# Package files

DOCFILES = COPYRIGHT Changes INSTALL PORTING README version.h dracauth.3 \
        rpc.dracd.1m dracd.allow-sample dracd-setup dracd-setup.linux
MAKEFILE = Makefile
RPC_SRC = drac.x
LIB_SRC = dracauth.c
SVC_SRC = rpc.dracd.c
TST_SRC = testing.c
PACKAGE = $(DOCFILES) $(MAKEFILE) $(RPC_SRC) $(LIB_SRC) $(SVC_SRC)
$(TST_SRC)

# Final targets

CLIENT = testing
SERVER = rpc.dracd
LIBRAR = libdrac.a

# rpcgen output

RPC_H = drac.h
RPC_XDR = drac_xdr.c
RPC_SVC = drac_svc.c
RPC_CLNT = drac_clnt.c
RPC_ALL = $(RPC_H) $(RPC_XDR) $(RPC_SVC) $(RPC_CLNT)

# Object files

LIB_OBJ = dracauth.o
SVC_OBJ = rpc.dracd.o
TST_OBJ = testing.o
H_OBJS = drac_xdr.o drac_svc.o drac_clnt.o $(SVC_OBJ) $(LIB_OBJ)
L_OBJS = $(LIB_OBJ) drac_xdr.o drac_clnt.o
S_OBJS = $(SVC_OBJ) drac_xdr.o drac_svc.o

# Rules

all: $(CLIENT) $(SERVER)

$(RPC_ALL): $(RPC_SRC)
        rpcgen $(RPCGENFLAGS) $(RPC_SRC)

$(H_OBJS): $(RPC_H)

$(LIB_OBJ) $(SVC_OBJ): $(MAKEFILE)

$(LIBRAR): $(L_OBJS)
        rm -f $@
        ar cq $@ $(L_OBJS)
        $(RANLIB) $@

$(CLIENT): $(TST_OBJ) $(LIBRAR)
        $(CC) -o $(CLIENT) $(TST_OBJ) $(TSTLIBS)

$(SERVER): $(S_OBJS)
        $(CC) -o $(SERVER) $(S_OBJS) $(LDLIBS)

clean:
        rm -f core $(RPC_ALL) $(H_OBJS) $(TST_OBJ) $(CLIENT) \
                $(SERVER) $(LIBRAR)

tar: $(PACKAGE)
        tar cf drac.tar $(PACKAGE)

install: $(SERVER)
        $(INSTALL) -c -o bin -g bin -m 0755 $(SERVER) $(EBIN)

install-man: $(SERVER).1m dracauth.3
        $(INSTALL) -c -m 0444 $(SERVER).1m
$(MAN)$(MANADM)/$(SERVER).$(MANADM)
        $(INSTALL) -c -m 0444 dracauth.3 $(MAN)$(MANLIB)/dracauth.$(MANLIB)

[root at helmethouse drac]#
----------------------------------------------------------------------------
---------------
S99dracd:
[root at helmethouse drac]# cat /etc/init.d/dracd
#!/bin/sh -
#
# dracd-setup

PATH=/usr/local/bin:/priv/usr/sbin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin
export PATH
DAEMON=rpc.dracd
#DRACD_PID=`ps -axc | grep 'rpc.dracd$' | sed -e 's/^  *//' -e 's/ .*//'`
#DRACD_PID=`ps -e | grep 'rpc.drac$' | sed -e 's/^  *//' -e 's/ .*//'`
DRACD_PID=`ps axc | grep 'rpc.drac' | sed -e 's/^  *//' -e 's/ .*//'`

dracd_running() {
        ps -p $DRACD_PID >/dev/null 2>&1
}

case "$1" in
start)
        if dracd_running; then
                echo "$DAEMON is already running" >&2
        else
                echo "starting $DAEMON" >&2
                $DAEMON
        fi
;;
stop)
        if dracd_running; then
                echo "stopping $DAEMON" >&2
                kill $DRACD_PID
        else
                echo "$DAEMON is not running" >&2
        fi
;;
*)
        echo "Usage: /etc/init.d/dracd-setup {start|stop}" >&2
;;
esac

#!/end
[root at helmethouse drac]#
---------------------------------------------------------------------
[root at helmethouse mail]# tail sendmail.mc
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
# dynamic relay authorization control map
Kdrac btree -o /etc/mail/dracd

[root at helmethouse mail]#
--------------------------------------------------------------------------
(Exerpt from /usr/share/sendmail-cf/m4/proto.m4)
######################################################################
###  check_rcpt -- check SMTP ``RCPT TO:'' command argument
######################################################################

SLocal_check_rcpt
# allow recent POP/IMAP mail clients to relay
R$*                     $: $&{client_addr}
R$+                     $: $(drac $1 $: ? $)
R?                      $@ ?
R$+                     $@ $#OK

Scheck`'_U_`'rcpt
R$*                     $: $1 $| $>"Local_check_rcpt" $1
R$* $| $#$*             $#$2
R$* $| $*               $@ $>"Basic_check_rcpt" $1

SBasic_check_rcpt
# empty address?
R<>                     $#error $@ nouser $: "553 User address required"
R$@                     $#error $@ nouser $: "553 User address required"
----------------------------------------------------------------------------
--------------------
[root at helmethouse mail]# cat /etc/mail/dracd.allow
# dracd.allow: clients trusted by rpc.dracd
#
# The format of this file is one of more lines of
#
# netmask netaddr
# Both netmask and netaddr must be dotted quads.
#
255.255.255.0 50.0.0.0
255.255.255.255 127.0.0.1
####
[root at helmethouse mail]#
----------------------------------------------------------------------------
------------






More information about the rhn-users mailing list