Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
67
rated 0 times [  67] [ 0]  / answers: 1 / hits: 84905  / 1 Year ago, fri, may 12, 2023, 11:59:22

I have some commands to in my rc.local. I know that they are failing. How can I get log file with messages produced by executing rc.local? Where is it located?



I have checked the /var/log/boot.log. I know my messages are not there because I know already what is the reason of failure. But I still want to make sure from log file.



Note, I don't want to run script again, I could but I don't want. I would rather analyse wht happened during startup.



Thanks for any help.



Ubuntu 12.04 Desktop (if it matters)


More From » boot

 Answers
2

Unless a command has output or logging already configured, rc.local commands will not log anywhere.



If you want to see logs for specific commands, try redirecting the stdout and stderr for rc.local to somewhere you can check. Try adding this to the top of your /etc/rc.local file:



exec 1>/tmp/rc.local.log 2>&1  # send stdout and stderr from rc.local to a log file
set -x # tell sh to display commands before execution


Though this will require to rerun the rc.local file.


[#26514] Saturday, May 13, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
itutejagua

Total Points: 89
Total Questions: 124
Total Answers: 113

Location: British Indian Ocean Territory
Member since Sun, Feb 13, 2022
2 Years ago
;