Hi,
 I am working on Red Hat Linux 7.1. In our application, syslog() (library call)
is used to Log to our log (/var/log/pbsc.log). This is done
by adding the following in /etc/syslog.conf and re-starting syslogd.

local0.*                        /var/log/pbsc.log
We want to add to This log file
done as : syslog(LOG_ERR,"Detected Board 0");

 as well to all terminals.
syslog(LOG_PERROR,"Detected Board 0");

This works fine ALWAYs if i run this code below, and in our application too.
But, our application also has to run when machine boots up. For this, i added
S99pbsc in /etc/rc.d/rc3.d/ to start our processes.
Our programs crash when we run thru this S99pbsc script. We are not doing any
thing different in Start script.

Example:
S99pbsc
has
/home/iee/pbsc/bin/run.sh

run.sh
-----------------
/home/iee/pbsc/bin/bsla&
------------------
/* code for bsla */
/* This works fine if i run /home/iee/pbsc/bin/run.sh when Linux has booted.
 * but, bsla process is killed all the time when it is started by
/etc/rc.d/rc3.d/S99pbsc
*/
#include <syslog.h>
#include <unistd.h>
#include <iostream>
#include <fstream>

main()
{
 openlog("PBSC",LOG_PERROR,LOG_LOCAL0);
 fstream file;
 file.open("/home/pbsc/sarae/proof",ios::out);
 file<< " Helllo from bsla process"<<endl;
  sleep(2);
 file<< " Helllo from bsla process: Before syslog."<<endl;
  syslog(LOG_PERROR,"Detected Board 0, let's see what happens\n");
 file<< " Helllo from bsla process: After syslog."<<endl;
  sleep(44);
}

Thanks very much for help.
 Regards,
samant




_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to