I didn't recompile everything I should have - going to have to try again tomorrow. It will take another hour or so to shutdown the servers, recompile, and reboot them. I'll keep you updated though. Thanks again for the help!
---------- Post updated 01-21-11 at 11:51 AM ---------- Previous update was 01-20-11 at 06:54 PM ----------
So unfortunately, I'm still getting a -1 returned from connect(). Here's my full code:
Code:
int
connection::get_connected (char * hostname, char * service)
{
struct hostent * hostentry; /* from gethostbyname */
struct servent * serventry; /* from getservbyname */
unsigned long ip_address;
struct sockaddr_in sa_in;
int our_port;
struct linger NoLinger;
int retval, err_code;
unsigned long ioctl_blocking = 1;
char message[512];
// if the ctor couldn't get a buffer
if (!in_buffer || !out_buffer)
return (ERR_CANT_MALLOC);
// --------------------------------------------------
// resolve the service name
//
// If they've specified a number, just use it.
if (gensock_is_a_number (service))
{
char * tail;
our_port = (int) strtol (service, &tail, 10);
if (tail == service)
{
return (ERR_CANT_RESOLVE_SERVICE);
}
else
{
our_port = htons (our_port);
}
}
else
{
// we have a name, we must resolve it.
serventry = getservbyname (service, "tcp");
if (serventry)
our_port = serventry->s_port;
else
return (ERR_CANT_RESOLVE_SERVICE);
}
// --------------------------------------------------
// resolve the hostname/ipaddress
//
// Assume only hostname
// if ((ip_address = inet_addr (hostname)) != INADDR_NONE) {
// sa_in.sin_addr.s_addr = ip_address;
// }
// else {
if ((hostentry = gethostbyname(hostname)) == NULL)
{
return (ERR_CANT_RESOLVE_HOSTNAME);
}
sa_in.sin_addr.s_addr = *(long *)hostentry->h_addr;
// }
// --------------------------------------------------
// get a socket
//
if ((the_socket = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
{
return (ERR_CANT_GET_SOCKET);
}
sa_in.sin_family = AF_INET;
sa_in.sin_port = our_port;
// set socket options. DONTLINGER will give us a more graceful disconnect
NoLinger.l_onoff = 0;
setsockopt(the_socket,
SOL_SOCKET,
SO_LINGER,
(char *) &NoLinger, sizeof(NoLinger));
// get a connection
memset(&sa_in, 0, sizeof(sa_in));
memcpy(&sa_in.sin_addr.s_addr, hostentry->h_addr, hostentry->h_length);
sa_in.sin_port=htons(our_port);
retval = connect (the_socket, (struct sockaddr *) & sa_in,
sizeof(sa_in));
if (retval == SOCKET_ERROR)
{
return (ERR_CANT_CONNECT);
}
#ifdef HA
// Make this a non-blocking socket
fcntl (the_socket, F_SETFL, O_NDELAY);
// make the FD_SET and timeout structures for later operations...
#endif
FD_ZERO (&fds);
FD_SET (the_socket, &fds);
// normal timeout, can be changed by the wait option.
timeout.tv_sec = 0;
timeout.tv_usec = 0;
return (0);
}
I'm lost at this point.
---------- Post updated at 12:03 PM ---------- Previous update was at 12:02 PM ----------
I should mention also that when I try to do 'print hostentry->h_addr' it says that's not a valid member... but it compiles fine with gmake. So I'm not sure.
I am new to the world of AIX. I want to get certified in AIX and learn it but fast. with in 3 months
Could you give me some advise of a good site that with teach you
or a bootcamp that is reasonable.
I am really in need
I am in atlanta (0 Replies)
Hi,
Am jus trying to find the Total RAM Size of a AIX m/c (in MB)..svmon works perfectly for a superuser...But i want to achive this as a normal user...Please help me out with correct command..
Best Regards,
Muthukumaran.M (3 Replies)
When we as normal user try to login, the session startup terminates and we are presented with the login screen.The root user is able to login without any problem.I can log in to the Aix server as normal user through telnet & using xmanager but not directly through server terminal .The Aix version... (1 Reply)
Hello everyone,
I am trying to create a forwarding scenario, and I do not seem to get it right!
I created a .forward file in the directory where my personal mailbox resides. In the file is the full address to deliver email to ... yet the emails do not seem to get forwarded.
Is there something... (3 Replies)
I have an Oracle database running on AIX, and I have a procedure that is calling OS commands from an oracle (and it's not working anymore)...
so, there was an Java stored proc in Oracle
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED COMMON."Host" as import java.io.*;
public class Host {... (1 Reply)
Hi,
I am trying to call sql script from ksh job with parameters.The parameters passed from ksh job will be used in SELECT query in sql file to SPOOL the data in extract file.My questions are:
1) How to call a sql script from ksh job with parameters?
2) How to use the parameter in sql file to... (1 Reply)
plzzz help me, I want to send emails for exchange group members when the used file-system % gets more than 90%, this notification must include df -g, netstat -i,and errpt with the hostname
thx in advance (0 Replies)
Hi,
My OS version is AIX 7.1. I am trying to send an email with a file to my mail address. sendmail or uuencode does not work. Can someone give me the correct format ?
I use:
uuencode <file name> | mail -s "subject" emailaddress
Thanks
Use code tags, thanks. (3 Replies)
Hello ,
I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by
EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt
Contents of... (6 Replies)
Hi,
I need to grant read permission to a normal user on sulog file on AIX 6.1.
As root I did acledit sulog and aclget shows "extended permissions" as "enabled" and normal user "splunk" has read permissions. When I try to access sulog as splunk user it won't allow and aclget for splunk user... (6 Replies)
Discussion started by: prvnrk
6 Replies
LEARN ABOUT DEBIAN
cvs-mailcommit
CVS-MAILCOMMIT(1) Debian GNU/Linux CVS-MAILCOMMIT(1)NAME
cvs-mailcommit - Send CVS commitments via mail
SYNOPSIS
cvs-mailcommit [options] [version*]
DESCRIPTION
cvs-mailcommit is a helper application to CVS to help people keep track of CVS repositories via mail. It is hooked into the CVS system via
the CVSROOT/loginfo file. It will read modification information from CVS via stdin and require version information via the commandline.
cvs-mailcommit will send differences of modified files or entire new files via mail to the denoted address.
You'll have to hook it into CVS for each module in a repository that you want to monitor via mail. See INSTALLATION below
OPTIONS
This program supports the following arguments. When the arguments don't make sense the program won't do anything.
-m address, --mailto address
Send the mail to the specified address. This option can be specified on the commandline multiple times.
--diff
Generate unified diffs for all modified files.
--full
Include the entire fill for newly created files that were added to the repository.
--maxlines nnn
You can specify how many lines per file may be quoted in the resulting mail. Limiting the number of quoted lines may be useful for
repositories with excessive changes that are similar. The default is to copy 400 lines.
--xloop address
Include a special X-Loop header in the generated mail. This is intended for users to be able to filter CVS mails by a common header
line. The line will look like
X-Loop: address
--from address
Generate a From:-line of the form
From: CVS User foo <address>
Otherwise the local user the program runs under will be used instead of address. With this parameter you can ensure that all such
mails will be sent with the same from line, which may be useful for moderated lists or some where only subscribers may write.
--replyto address
Try to redirect replies to CVS mails to another address by setting proper header lines such as
Reply-To: address
Mail-Followup-To: address
--approved address
Include a special Approved:-line in the mail. This header is intended for moderated mailing-lists to pass the SmartList moderation
mechanism. The created header will look like
Approved: address
--cvs version string
This option carries the CVS version info from CVS into the program. It will be added automatically by CVS. When installing this
program into the loginfo file of a CVS repository, you will need to add the following option:
--cvs %{sVv}
If you want to test this program manually you'll have to supply the module directory and the modified files including the old and new
versions. This will look like
--cvs 'CVSROOT loginfo,1.1,1.2'
This option is only usful for old-style CVS format strings (i.e. prior to CVS 1.12.6). You can continue using old-style format
strings with newer cvs if you write %1{sVv} and set UseNewInfoFmtStrings=yes in CVSROOT/config. For more recent versions of CVS you
should, however, use the new --root and --dir arguments and place %{sVv} at the end of the commandline.
--root cvs repository
Specify the CVS repository directory. This is normally done by the CVS server. Prior to version 1.12 the repository was transmitted
to the log processor via the CVSROOT environment variable. The parameter to this option is normally filled in by CVS using the %r
format string:
--root %r
--dir module directory
Specify the directory within the CVS repository in which directories or file were added or modified. The parameter to this option is
normally filled in by CVS using the %p format string:
--dir %p
CONFIGURATION FILE
cvs-mailcommit supports an additional configuration file /etc/cvs-mailcommit.pl so that hard-coded default values can be overwritten. The
file is included via require and hence needs to contain valid Perl code, which evaluates to true. I.e. place 1; at the end of the file.
INSTALLATION
The CVSROOT/loginfo file controls where cvs commit log information is sent. The first entry on a line is a regular expression which must
match the directory (alias module) that the change is being made to, relative to the $CVSROOT. If a match is found, then the remainder of
the line is a filter program that should expect log information on its standard input.
A loginfo line looks like
<directory> <command> --<option> --<option>
NOTES
The --cvs option is only valid for old-style CVS format strings prior to version 1.12.6 of CVS with %{sVv} or for new-style CVS format
strings using the compatibility hack with %1{sVv}.
For new-style CVS format strings for CVS version 1.12.6 or higher --cvs must not be used anymore, but instead --root and --dir are
required. The version information %{sVv} must be added at the end of the command line.
EXAMPLE
Assume you want to monitor changes in the CVSROOT module, then you may want to use the following line.
CVSROOT cvs-mailcommit
--mailto master@host.org
--from cvs@cvshost.com
--cvs %{sVv} --diff --full
If you want to distribute changes in a module via a mailing list where only these log messages should appear you may have to add an X-Loop:
or Approved: header line.
webwml cvs-mailcommit
--mailto master@host.org
--from cvs@cvshost.com
--approved cvsmaster@cvshost.com
--cvs %{sVv} --diff --full
The above configuration lines are valid only for old-style format strings. With a more recent version of CVS (1.12.6 or newer) you'll have
to replace %{sVv} with %1{sVv} and set UseNewInfoFmtStrings to yes in CVSROOT/config.
For new-style CVS format strings other parameters need to be used since CVS changed the syntax and semantics. You must not use the --cvs
option anymore but need to use --root and --dir and place the version list at the end. The last example converted for new-style format
strings looks like the following:
webwml cvs-mailcommit
--mailto master@host.org
--from cvs@cvshost.com
--approved cvsmaster@cvshost.com
--diff --full --root %r --dir %p %{sVv}
To improve readability, the above lines were broken up into several lines using normal continuation lines. This is not supported by CVS.
You will have to write it in one single line.
WARNING
CVS does not support continuation lines (multiple lines per command) in the CVSROOT/loginfo file. You'll have to write each filter in a
single line of its own.
SOURCE
http://www.infodrom.org/Infodrom/tools/cvs-mailcommit.html
Debian Project 2004-08-09 CVS-MAILCOMMIT(1)