Sponsored Content
Operating Systems OS X (Apple) How can I direct messages from mac console.app to a log file? Post 303038443 by dallas88 on Tuesday 3rd of September 2019 09:22:48 AM
Old 09-03-2019
How can I direct messages from mac console.app to a log file?

I'm trying to complete a bash script to capture if an external webcam is active in a video conference session. Some users will switch the camera to the built-in MAC camera. When this happens I want to trigger a set of events.

Things tried: reviewed the console.app to look for patterns on when the switch occurs in a user test & discovered messages indicating when the facetime camera changes state. I found this

Code:
019-08-31 22:59:57.387405 -0500 AppleCameraInterface default 0 22:59:57.387405 -0500 kernel AppleCamIn::power_on_hardware

2019-08-31 22:59:57.814936 -0500 AppleCameraAssistant default 438 22:59:57.814936 -0500 AppleCameraAssistant StartHardwareStream: creating frame receiver: 1280 x 720 (420v) [12.00,30.00]fps

2019-08-31 22:59:59.679037 -0500 AppleCameraAssistant default 438 22:59:59.679037 -0500 AppleCameraAssistant StopHardwareStream 2019-08-31 22:59:59.809252 -0500 AppleCameraInterface default 0 22:59:59.809252 -0500 kernel AppleCamIn::power_off_hardware

I thought I could simply grep these message from the console.app but it seems to be easier said than done. I thought i could find the msgs in one of the console report files but When I look at the various reports on the console, i'm not finding a report that contains the messages above. How can I direct messages from console.app to a log file versus manually copying and pasting the info from the console?or point me to a direction? Am I missing something?
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Re-direct the error msg to log file

Hi All, I have an expression as follows:- a=`expr ${i} + ${j}` >> $log_file 2>&1 Here, if any of the values i or j or both happens to be empty then the "expr" returns error as "expr: 0402-050 Syntax error." My problem is I am not able to re-direct this error to the log file. Its is getting... (4 Replies)
Discussion started by: rony_daniel
4 Replies

2. Shell Programming and Scripting

Direct the output of a script to a log file

Hi, I have a script to compare 2 files. file1=$1 file2=$2 num_of_records_file1=`awk ' END { print NR } ' $file1` num_of_records_file2=`awk ' END { print NR } ' $file2` i=1 while do sed -n "$i"p $file1 > file1_temp sed -n "$i"p $file2 > file2_temp diff file1_temp... (5 Replies)
Discussion started by: autosys_nm
5 Replies

3. Shell Programming and Scripting

Set default app for file type on Mac

Hi there, We have 2 apps on our customers machines that can both open files with the same file extension. Is there any way via shell commands to set which application should be the default? Essentially, I'm hoping to replicate Get Info > Open With > Change All using a shell script, but I just... (0 Replies)
Discussion started by: davewg
0 Replies

4. Shell Programming and Scripting

Need Mac .sh to run command line app in seperate terminal

Hello, currently we are executing a .sh from terminal. The current .sh looks like this: #!/usr/bin/env bash /Users/user/my.app/Contents/MacOS/my & -- Now, we also need to run a third line in the .sh - It's a command line application that I need to run when I execute the above .sh... (0 Replies)
Discussion started by: yoyoyo777
0 Replies

5. UNIX for Dummies Questions & Answers

re-direct to log file

#!/bin/ksh -x cd /tmp/tj ftp -n servername.com << DONE user username password as put test.log quit close DONE echo "testing..." sh -x scriptname, and it shows all, but username, as, put, quit, close, DONE. how can i see those ? (1 Reply)
Discussion started by: tjmannonline
1 Replies

6. Shell Programming and Scripting

Manipulating sed Direct Input to Direct Output

Hi guys, been scratching round the forums and my mountain of resources. Maybe I havn't read deep enough My question is not how sed edits a stream and outputs it to a file, rather something like this below: I have a .txt with some text in it :rolleyes: abc:123:xyz 123:abc:987... (7 Replies)
Discussion started by: the0nion
7 Replies

7. Cybersecurity

Best practice to allow 3rd party app to read messages file.

What is the best practice to allow a 3rd party health monitoring app to read the messages file. Since messages is a system file and is owned by root the app cannot read the file. I don't want to run the app as root so how should I allow the app to read the file. The read function is actually built... (2 Replies)
Discussion started by: slwiley
2 Replies
pam_console_apply(8)					   System Administrator's Manual				      pam_console_apply(8)

NAME
pam_console_apply - set or revoke permissions for users at the system console SYNOPSIS
pam_console_apply [-f <fstab file>] [-c <console.perms file>] [-r] [-t <tty>] [-s] [-d] [<device file> ...] DESCRIPTION
pam_console_apply is a helper executable which sets or resets permissions on device nodes. If /var/run/console.lock exists, pam_console_apply will grant permissions to the user listed therein. If the lock file does not exist, permissions are reset according to defaults set in console.perms files, normally configured to set permissions on devices so that root owns them. When initializing its configuration it first parses the /etc/security/console.perms file and then it searches for files ending with the .perms suffix in the /etc/security/console.perms.d directory. These files are parsed in the lexical order in "C" locale. Permission rules are appended to a global list, console and device class definitions override previous definitions of the same class. ARGUMENTS
-c Load other console.perms file than the default one. -f Load other fstab file than the default one (/etc/fstab). -r Signals pam_console_apply to reset permissions. The default is to set permissions so that the user listed in /var/run/console.lock has access to the devices, and to reset permissions if no such file exists. -t Use <tty> to match console class in console.perms file. The default is tty0. -s Write error messages to the system log instead of stderr. -d Log/display messages useful for debugging. The optional <device file> arguments constrain what files should be affected by pam_console_apply. If they aren't specified permissions are changed on all files specified in the console.perms file. FILES
/var/run/console.lock /etc/security/console.perms /etc/security/console.perms.d/50-default.perms SEE ALSO
pam_console(8) console.perms(5) BUGS
Let's hope not, but if you find any, please report them via the "Bug Track" link at http://bugzilla.redhat.com/bugzilla/ AUTHORS
Nalin Dahyabhai <nalin@redhat.com>, using code shamelessly stolen from parts of pam_console. Support of console.perms.d and other improvements by Tomas Mraz <tmraz@redhat.com>. Red Hat 2005/5/2 pam_console_apply(8)
All times are GMT -4. The time now is 07:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy