Log file to show if loginhook has run or not

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Log file to show if loginhook has run or not
# 1  
Old 10-08-2009
Log file to show if loginhook has run or not

Which log file lists the activity of startup scripts, particularly loginhooks? I am trying hard to find it and I cannot. How can I even tell if my script is running without errors if there isnt a log? Very frusturating!
# 2  
Old 10-14-2009
It is up to you to use whatever log file you want to return success and/or failure information.

In your LoginHook, use the "logger" command to send the status to /var/log/system.log

You could start your script with a simple "running LoginHook" to determine if the hook is actually getting called successfully. Then you can test for success or failure of the various operations in the LoginHook script by testing $? after each, and report based on that.

So:
logger -p local0.notice "LoginHook: LoginHook started at "`date`

at the beginning of your LoginHook would indicate it started nicely.

Entering additional LoginHook task success or failure really helps troubleshooting, so
logger -p local0.notice "LoginHook: yourcommandhere OK/failed "`date`

man logger
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. Shell Programming and Scripting

Log file is not updating when I run shell scripts scheduled thru crontab

Hi Forum, Good Day! I have created an empty html file wtih permissoin 777 created shell script(with permission 777) , code is below. #=======================start============== . /data09/oracle/apps_st/appl/D_oraapp095.env rm -rf /home/mnp/Test_log.txt echo... (1 Reply)
Discussion started by: kartheekbk
1 Replies

3. Homework & Coursework Questions

Program run perfectly without error but cant show anything

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: No problem,but it cannot show what I want 2. Relevant commands, code, scripts, algorithms: wc test.cpp wc... (1 Reply)
Discussion started by: guankin
1 Replies

4. Shell Programming and Scripting

Script to read a log file and run 2nd script if the dates match

# cat /tmp/checkdate.log SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 17 22:49:00 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production FIRST_TIME NEXT_TIME... (1 Reply)
Discussion started by: SarwalR
1 Replies

5. Shell Programming and Scripting

help with email to be triggered based on fatal error detection from batch run log file neded

Hi, I require need help in two aspects actually: 1) Fatal error that gets generated as %F% from a log file say ABClog.dat to trigger a mail. At present I manually grep the log file as <grep %F% ABClog.dat| cut-d "%" -f1>. The idea is to use this same logic to grep the log file which is... (1 Reply)
Discussion started by: zico1986
1 Replies

6. UNIX for Dummies Questions & Answers

Will this show contents of file

Hi Team, I have a couple of questions. I happen to come across a code like this which i was asked to trouble shoot. Any idea what these two do? 1. cat $(file?File doesn't exist); 2. mydir=/home/user/axa032; echo $(mydir-/home/a2self); Can some one help me with this ? ... (2 Replies)
Discussion started by: kinny
2 Replies

7. Shell Programming and Scripting

Logging ALL standard out of a bash script to a log file, but still show on screen

Is it possible to store all standard-out of a bash script and the binaries it calls in a log file AND still display the stdout on screen? I know this is possible to store ALL stdout/stderr of a script to a single log file like: exec 1>&${logFile} exec 2>&1 But running a script with the... (3 Replies)
Discussion started by: ckmehta
3 Replies

8. Shell Programming and Scripting

Show file to new format

Hi all If my text file as follow: group size time file other 58585739 2008 test1.csv other 122 2008 testcsv.sh other 164 19:28 testexplain.sh other 29132428 2008 testq.csv other 104 21:02 testshell.sh other 792 21:39 xxx.txt I need to show file to new format as follow: group... (1 Reply)
Discussion started by: almanto
1 Replies

9. Shell Programming and Scripting

Capture the command run in the log file

Hi , I have seen some log files where they have captured the command that is being executed, comments present in the scripts and the out put of the command as well, through scripts. could any one of you please let me know how do i do that? Thanks in advance. Cheers, Waseem (4 Replies)
Discussion started by: ahmedwaseem2000
4 Replies
Login or Register to Ask a Question