crt0: ERROR couldn't open /usr/lib/dld.sl errno:000000024

crt0: ERROR couldn't open /usr/lib/dld.sl errno:000000024

Post by TMILLE » Fri, 29 Jan 1999 04:00:00



Hello,

I have written a daemon program that will take a file created by another
process, execute this file (it is a shell script), and create a return file
so that the original process knows whether or not the file was processed
successfully.  My problem is that after the daemon program is running for
about 10 to 20 seconds, I am receiving the following error:

        crt0: ERROR couldn't open /usr/lib/dld.sl errno:000000024

I am running the program on an HP-UX B.10.20 A 9000/750 machine.

Here is the program:

/*       Library Includes               */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <crypt.h>
#include <fcntl.h>
#include <errno.h>
#include "nlkdmon.h"

/*       Symbolic Constants             */
#define TRUE 1
#define FILE_MODE ( S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH )
#define MAXLINE 4096
#define write_lock(fd, offset, whence, len) \
        lock_reg(fd, F_SETLK, F_WRLCK, offset, whence, len)

/*       Function prototypes            */
void check_daemon_running(void);
int lock_reg(int fd, int cmd, int type, off_t offset, int whence, off_t
len);
int update_ca_unicenter (char * infilename);
int retrieve_mqm_dir (char * mqmDataDir);
int create_hold_dir(char * mqmDataDir);

/*       Global variables               */
char pgmname[9];
char pidfile[100];

int main(int argc, char * argv[])
{
  FILE *outFilePtr, *filesPtr;
  char outfilename[100], filelist[100];
  char holdDir[200] = {" "};
  int upd_rc, rc;
  char infilename[100] = {" "};

  struct Outrec OutData, *OutDataPtr;

  OutDataPtr = &OutData;

  if (argc != 2)
  {
    fprintf( stderr, "Usage: %s <directory location for files>  return code
= 1\n", argv[0] );
    return 1;
  } /* End if argc not = 2 */
  else
  {
    strcpy (pgmname, argv[0]);
    strcpy (pidfile, argv[1]);
    strcat (pidfile, "/pidfile");
  } /* End else argc = 2 */

  check_daemon_running();

  rc = retrieve_mqm_dir (mqmDataDir); /* Gets directory location for input
files */

  if (rc == 0)
  {
    strcpy(holdDir, mqmDataDir);
    strcat(holdDir, "/hold");
    rc = create_hold_dir(holdDir); /* Creates a hold directory for files to
be processed at a later time */
  } /* End rc equal 0 */

  if (rc != 0)
    return 1;

/ * Set up the infinite loop for the daemon to continue running */
  while (TRUE)
  {
    sprintf(filelist, "%s/filelist", mqmDataDir);

    sprintf(command, "ls -1 %s/*.*dat 2>/dev/null > %s", mqmDataDir,
filelist);
    system(command);

    if ((filesPtr = fopen(filelist, "rb")) != NULL)
    {
      fscanf(filesPtr, "%s", infilename);

      while (! feof (filesPtr))
      {
        strcpy(outfilename, infilename);
        strcat(outfilename, "Return");

        if ((outFilePtr = fopen(outfilename, "wb")) == NULL)
        {
          printf("\nOuput file, %s, could not be opened\n", outfilename);
        } /* End if outFile not open */

        upd_rc = update_ca_unicenter(infilename);

        sprintf(OutDataPtr->status,"%i", upd_rc);
        fwrite(&OutData, sizeof(struct Outrec), 1, outFilePtr);

        fclose(outFilePtr);

        if (upd_rc == 0)
        {
        /* Remove data file so that it is not re-processed */
          sprintf(command, "rm %s 2>/dev/null", infilename);
          system(command);
        } /* End if upd_rc equal 0 */
        else
        {
          sprintf(command, "mv %s %s", infilename, holdDir);
          system(command);
        } /* End else upd_rc not equal 0 */

        fscanf(filesPtr, "%s", infilename);
      } /* End while more files to process */
    } /* End if filelist open successful */

    usleep(500000);
  } /* End while true */

  return 0;

Quote:} /* End of nlkdmon main */

I have used the examples from the R. Stevens book on creating daemon
programs.  My compiler is on a different HP so I FTP the object module over
to this machine and run the following make file to create my executable:

ROOTDIR=..
BINDIR=${ROOTDIR}/bin
OBJDIR=${ROOTDIR}/obj
LIBDIR=/usr/lib

LDFLAGS=/usr/ccs/lib/crt0.o -lc
.SUFFIXES: .c.C.o

${BINDIR}/nlkdmon : ${OBJDIR}/nlkdmon.o

I would greatly appreciate any help or guidance that anyone could give to me
for this problem.  Also, since this is my first attempt at creating a daemon
program, I would appreciate any suggestions for improvement.

Thank you for your help,

Teresa Miller

 
 
 

crt0: ERROR couldn't open /usr/lib/dld.sl errno:000000024

Post by Peter van Hoo » Mon, 01 Feb 1999 04:00:00



Quote:>Hello,
>I have written a daemon program that will take a file created by another
>process, execute this file (it is a shell script), and create a return file
>so that the original process knows whether or not the file was processed
>successfully.  My problem is that after the daemon program is running for
>about 10 to 20 seconds, I am receiving the following error:
>        crt0: ERROR couldn't open /usr/lib/dld.sl errno:000000024

Without looking at your code: /usr/include/sys/errno.h says errno
24 is 'Too many open files'.  Check your code for missing close()s.

groetjes,

peter

 
 
 

1. /usr/lib/dld.sl: Call to mmap() failed

HP9000/K220
HPUX 10.20
Apache 1.3.9

I pulled the 1.3.9 distribution off the HP web site.
      apache_1.3.9-hp9000_715-hpux10.20.tar.gz

I ran
 install-bindist.sh /opt/apache

We made some changes to the httpd.conf (e.g.
user, group, additional directives for other functionality).

When I try to start apache, I get the following:

#  /opt/apache/bin/apachectl start
/usr/lib/dld.sl: Call to mmap() failed - TEXT /opt/apache/libexec/mod_env.so
/usr/lib/dld.sl: Permission denied
Syntax error on line 222 of /opt/apache/conf/httpd.conf:
Cannot load /opt/apache/libexec/mod_env.so into server: Permission denied
/opt/apache/bin/apachectl start: httpd could not be started
#

I also tried to run the httpd start   by itself.  It complained about
not being able to find /usr/local/apache/conf/httpd.conf.
I created a softlink to /opt/apache/conf.httpd.conf.  Now the httpd start
gives the same messages as above.

Any ideas?

Regards,
Mike

2. .bashrc aliases

3. Viper: Couldn't open RGB_DB '/usr/X386/lib/X11/rgb'

4. Netscape 4.5 annoying popupwindows about XmTextField

5. VNC: Couldn't open RGB_DB '/usr/lib/X11/rgb.txt'

6. Logitech Mouse problems with X

7. crt0 Error: mmap failed for dld (text) errno: 000000013

8. how2 automate ftp ?

9. crt0 Error: mmap failed for dld (text) errno: 000000013 at boot on HPUX 10.10

10. /usr/lib/pa20_64/dld.sl: Unable to find library HP-UX 64bit

11. /usr/lib/gcc-lib/i386-linux and /usr/lib/gcc-lib/i486-linux

12. Needed: ld's /usr/lib/crt0.o

13. What's the meaning of /usr/lib/crt0.o?