LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   initialisation log (https://www.linuxquestions.org/questions/fedora-35/initialisation-log-647622/)

yosato_uk 06-07-2008 09:02 AM

initialisation log
 
Hi,

I use Fedora 8 and just wonder where the messages on the initialisation scripts are recorded that appear when you boot up. That is stuff like

nfsd... [OK]
sshd... [fail]
...
etc

I can't locate this in the /var/log/ directory. Would you need to change syslog.conf etc?

Your help would be very much appreciated.

Yo

MensaWater 06-08-2008 10:42 AM

Haven't done this myself but on researching the question because I was curious. I found that you basically need to add a logger line to the start and stop sections of each init script.

Examples I see in /etc/init.d/diskdump:

Code:

start_device() {
        local dev=$1

        errmsg=$($DISKDUMPCTL $dev 2>&1)
        ret=$?
        if [ $ret -ne 0 ]; then
                logger -p info -t $SERVICE_NAME "$errmsg"
        fi
}

stop_device() {
        local dev=$1

        errmsg=$($DISKDUMPCTL -u $dev 2>&1)
        if [ $? -ne 0 ]; then
                logger -p info -t $SERVICE_NAME "$errmsg"
        fi
}

In the above basicaly it is saying to only log the information if there is a non-zero exit status (meaning it failed). You'd want to simply get rid of the if, then, fi so that it logged everything.

The OK/FAILED actually comes from the functions (see the file invoked at start of init scripts) so to actually see the OK/FAILED itself you'd likely have to modify that function script.

Unfortunately I didn't find any examples of anyone doing this.

Interestingly on HP-UX they have it setup to go to an rc.log by default but they do it differently than Linux.


All times are GMT -5. The time now is 12:38 PM.