Find the answer to your Linux question:
Results 1 to 4 of 4
Hi everybody, I need to do an easy task but I don't know how to do it. I have a shell script called "first" executed as a daemon in runlevel ...
  1. #1
    Just Joined!
    Join Date
    Jul 2006
    Posts
    51

    Create an own log file

    Hi everybody,

    I need to do an easy task but I don't know how to do it.

    I have a shell script called "first" executed as a daemon in runlevel 3, where I have put a soft link (/etc/rc3.d/S99first) to make it start when console changes to runlevel 3.

    I want to create a new logfile called /tmp/logfirst where output of changing runlevel 3 is written.

    How can I do that?

    Firstly I need to know where messages of changing runlevels are stored...and then I suposo I will have to redirect it to /tmp/logfirst...

    any ideas??

    Thanks!

    Aleix

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    951
    I think changes in run level are logged in /var/log/syslog. But why not make your script use logger to send a message to a log file of your choosing?
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  3. #3
    Just Joined!
    Join Date
    Jul 2006
    Posts
    51
    Hi!

    these would be one way, but the problem is that the script is a C binary, and I don't have the source code to change it.

    So, I need to redirect the messages produced with this program to a new log file, using system files.

    Aleix

  4. #4
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    951
    Er??! You said before that it was a shell script. Well, if it's a binary and you can't recompile it, you will need to find out what facility it logs under (probably daemon) and edit /etc/syslog.conf to send those messages elsewhere.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •