On 02-14-2024 06:56AM, Carlos E. R. wrote:
On 2024-02-14 07:45, -pj via openSUSE Users wrote:
On 02-13-2024 09:57PM, Carlos E. R. wrote:
On 2024-02-14 03:40, -pj via openSUSE Users wrote:
On 02-13-2024 04:49PM, Carlos E. R. wrote:
On 2024-02-13 23:34, -pj via openSUSE Users wrote:
On 02-13-2024 05:59AM, Carlos E. R. wrote: > On 2024-02-13 00:13, -pj via openSUSE Users wrote:
...
Trick:
logger -t Mine -p local1.info "The script works."
(local "one")
When you speak of "(local "one")" I do not understand what you are referring to very well. Can you please explain this a bit more perhaps?
That the "1" in the name is a one, not a lower case "L". There are local1, local2,...local7. I don't remember if more. I can give you tomorrow the rest of the names (I have to find them). See the man page. I apologize for not seeing the clarity which you presented in "(local "one")" initially. I for some reason was thinking something else was possibly meant by this.
Ah, found them: The syslog (2) on this machine here contains the similar if not same to displayed below. I was completely oblivious to the connection of syslog and journalctl output before. I see now there is a sort of connection at least.
Journal is a redesign of syslog, but many admins prefer syslog. You can have both.
#CER docs, from syslog(2)
#define KERN_EMERG "<0>" /* system is unusable */ Is this what you are refering to by "local1" (below)?
Below. It took me some time, long ago, to find the exact definitions. See *88* below. Ok I see.
#define KERN_ALERT "<1>" /* action must be taken immediately */
...
#/* other codes through 15 reserved for system use */ reserved for local use #define LOG_LOCAL0 (16<<3) /* reserved for local use */ #define LOG_LOCAL1 (17<<3) /* reserved for local use */
This one. I see, I was not looking closely enough again.
The actual one you use is arbitrary. But the facility and level you select are used in the syslog filtering (/etc/rsyslog.conf or equivalent) to choose what file the entry is filed in. Quick thought to ask you. Do you typically modify "/etc/rsyslog.conf"?
In journalctl it is a single file, but you can filter the output:
-p, --priority= Filter output by message priorities or priority ranges. Takes either a single numeric or textual log level (i.e. between 0/"emerg" and 7/"debug"), or a range of numeric/text log levels in the form FROM..TO. The log levels are the usual syslog log levels as documented in syslog(3), i.e. "emerg" (0), "alert" (1), "crit" (2), "err" (3), "warning" (4), "notice" (5), "info" (6), "debug" (7). If a single log level is specified, all messages with this log level or a lower (hence more important) log level are shown. If a range is specified, all messages within the range are shown, including both the start and the end value of the range. This will add "PRIORITY=" matches for the specified priorities.
This gets very detailed.
--facility= Filter output by syslog facility. Takes a comma-separated list of numbers or facility names. The names are the usual syslog facilities as documented in syslog(3). --facility=help may be used to display a list of known facility names and exit.
#define LOG_LOCAL2 (18<<3) /* reserved for local use */ #define LOG_LOCAL3 (19<<3) /* reserved for local use */
...
#!/bin/bash echo KBC0 >/proc/acpi/wakeup echo "Disabling wakeup in PS2 keyboard" >> /tmp/PS2-Keyboard.txt logger -t Mine -p local1.info "Disabling wakeup in PS2 keyboard" -
Certainly. Maybe "-t HP-PS2-Keyboard.sh", though. Up to you. :-) Yes, I made a somewhat dumb error (please see below for update). :[
It's nice to have this so functional now. Many Thanks
Welcome :-)
Thanks again. :|
Ok, I really do not want to push my luck here with the great help you have provided so far but I really do want to ask a few more questions about this situation here with the keyboard. PS2-Keyboard.sh is changed to as follows: - Thinkcentre-M57p:/usr/local/sbin> cat PS2-Keyboard.sh #!/bin/bash echo KBC0 >/proc/acpi/wakeup echo "Disabling wakeup in PS2 keyboard" >> /tmp/PS2-Keyboard.txt echo logger -t PS2-Keyboard.sh -p local1.info "Disabling wakeup in PS2 keyboard"
No.
logger -t PS2-Keyboard.sh -p local1.info "Disabling wakeup in PS2 keyboard"
It is a command. Echo prints it, not runs it.
You have clarified my mind on this and again, thank you. I have made the critical needed adjustments and saved file, /usr/local/sbin/PS2-Keyboard.sh as follows: #!/bin/bash echo KBC0 >/proc/acpi/wakeup echo "Disabling wakeup in PS2 keyboard" >> /tmp/PS2-Keyboard.txt logger -t PS2-Keyboard.sh -p local1.info "Disabling wakeup in PS2 keyboard" Current Permissions for the file: -rwxr-xr-x 1 root root 182 Feb 14 14:55 PS2-Keyboard.sh
- Is, "echo logger -t PS2-Keyboard.sh -p local1.info "Disabling wakeup in PS2 keyboard" what i'm actually after here (for kernel alerts)?
I don't know what you are looking for "kernel alerts", I'm lost now.
Do not be lost please. I was once again mistaken in the above comment. It was referring to my incorrect thought on.> #define KERN_ALERT "<1>" /* action must be taken immediately */ Please see *88* above.
"logger" simply enters some arbitrary text into the system logs (and journal), so that the human administrator can read them and find out what was going on when.
Ok, very good explanation.
and you will see that line printed in "journalctl" output.
I have powercycled the machine. Then complete two suspend/unsuspend cycles. Then in Konsole pass: journalctl | grep -i "PS2\|Keyboard"
Scrolling down to today's date. Shows what seems to me as somewhat sporatic results for: PS2-Keyboard.sh (meaning each time a suspend/unsuspend cycle completes), does not add a fresh log entry, (viewable in Konsole) even after journalctl | grep -i "PS2\|Keyboard" is passed yet again (after unsuspend completes). See sporatic displayed entry below.
You disabled the log entry by using "echo" in the line.
Yes, I have corrected that "echo" mistake now, please see above. I have also altered the journalctl syntax being used to the following: journalctl -b -1 | grep "PS2\|Keyboard" now. Is this similar to what you would recommend?>
Feb 13 22:27:18 Thinkcentre-M57p PS2-Keyboard.sh[1820]: Disabling wakeup in PS2 keyboard
Why is a fresh entry of the above "PS2-Keyboard.sh[1820]: Disabling wakeup in PS2 Keyboard" not created every suspend/unsuspend cycle completion? ------------------------------------------------------------------------- Finally, there are many errors displayed (from one source) by journalctl output, about 'executable permissions' as follows:
Thinkcentre-M57p systemd[1]: Configuration file /etc/systemd/system/PS2-Keyboard.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Do as it says.
I have done as it says with the current permissions set now to the following: -rw-r--r-- 1 root root 331 Feb 13 17:38 PS2-Keyboard.service
-rwxr-xr-x 1 root root 331 Feb 13 17:38 PS2-Keyboard.service
My mind starts thinking to pass the following: chmod ugo-x PS2-Keyboard.service
All the other directories *and* entries in /etc/systemd/system have 'ugo+x' permissions set. What's going on here with that?
Directories have +x, not files. The meaning of 'x' is different for directories. And links have all flags.
Thinking back I did make PS2-Keyboard.service executable after creating the file that was obviously a mistake which I corrected now. -Best Regards :|