Notifications
Clear all
Technial Support / Discussion
1
Posts
1
Users
0
Likes
15
Views
Topic starter
Right,
I am trying to log some messages to the syslog file when I stop and stop my Rpi.
These are my files:
beforeScript.sh
##!/bin/bash
# file: beforeScript.sh
#
# This script will run after Raspberry Pi boot up, and before running the schedule script.
# If you want to change the schedule script before running it, you may do so here.
#
# Remarks: please use absolute path of the command, or it can not be found (by root user).
# Remarks: you may append '&' at the end of command to avoid blocking the main daemon.sh.
#
sudo /usr/bin/logger '******************************************* beforeScript'
beforeShutdown.sh
#!/bin/bash
# file: beforeShutdown.sh
sudo /usr/bin/logger '**************************************** beforeShutdown'
afterStartup.sh
#!/bin/bash # file: afterStartup.sh # # This script will run after Raspberry Pi boot up and finish running the schedule script. # If you want to run your commands after boot, you can place them here. # # Remarks: please use absolute path of the command, or it can not be found (by root user). # Remarks: you may append '&' at the end of command to avoid blocking the main daemon.sh. # sudo /usr/bin/logger '******************************************* afterStartup'
I performed two scenarios:
I have opened a terminal. I have rebooted the Rpi.
I press my momentaty swicth then is connected to GPIO4. Terh Rpi shuts down. I press the buttin again. The Rpi starts up.
Now when I look in my syslog file I can see no record of my logging.
Please advise?
Posted : 20/12/2024 2:58 pm