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.
#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. 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. 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. --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 :-)
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.
- 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. "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.
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.
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.
-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.
-------------------------------------------------------------------------- Is this thinking of mine correct about "PS2-Keyboard.service"? Can you suggest a journalctl command that could be more ideal in monitoring the keyboard messages, getting things set up?
Thanks again for your insight.
-- Cheers / Saludos, Carlos E. R. (from 15.5 x86_64 at Telcontar)