Where does stderr go to during boot (SysVinit)?
I'm trying to diagnose some boot problems I am having with a custom linux kernel that I have configured and built. I've been digging through some of the source code for klogd, and apparently, if debugging is enabled (via the -d option), it should be printing some error messages to stderr. I know that on a terminal, stderr usually goes to the same place as stdout; however, in this case, there is some issue with the screen/console configuration and so nothing is printing to the screen at all during boot (although kernel boot messages are being printed to /var/log/kern.log
).
However, the klogd stderr messages that I'm expecting don't seem to be getting printed to that log file.
So, my question is: where are prints to stderr supposed to be going to during the SysVinit boot sequence? Is it possible to redirect all of these to a file? If so, what is the best way to do that in the init scripts?
Thanks in advance!
Edit: Contents of /etc/syslog.conf:
# Begin /etc/syslog.conf
auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *
# End /etc/syslog.conf
boot io-redirection sysvinit stderr
add a comment |
I'm trying to diagnose some boot problems I am having with a custom linux kernel that I have configured and built. I've been digging through some of the source code for klogd, and apparently, if debugging is enabled (via the -d option), it should be printing some error messages to stderr. I know that on a terminal, stderr usually goes to the same place as stdout; however, in this case, there is some issue with the screen/console configuration and so nothing is printing to the screen at all during boot (although kernel boot messages are being printed to /var/log/kern.log
).
However, the klogd stderr messages that I'm expecting don't seem to be getting printed to that log file.
So, my question is: where are prints to stderr supposed to be going to during the SysVinit boot sequence? Is it possible to redirect all of these to a file? If so, what is the best way to do that in the init scripts?
Thanks in advance!
Edit: Contents of /etc/syslog.conf:
# Begin /etc/syslog.conf
auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *
# End /etc/syslog.conf
boot io-redirection sysvinit stderr
It's system dependent whether boot messages (stdout and stderr) are printed to a serial port, for example. For the log files, I think you should include your/etc/rsyslog.conf
.
– Philippos
Nov 2 '17 at 8:48
@Philippos: Just added the contents of my /etc/syslog.conf (this is a Linux From Scratch installation, so it's unmodified from what is recommended there). However, my understanding was that this file governs what happens to 'system log messages' specifically, not necessarily any print to stderr. I could easily be mistaken though.
– Time4Tea
Nov 2 '17 at 11:02
add a comment |
I'm trying to diagnose some boot problems I am having with a custom linux kernel that I have configured and built. I've been digging through some of the source code for klogd, and apparently, if debugging is enabled (via the -d option), it should be printing some error messages to stderr. I know that on a terminal, stderr usually goes to the same place as stdout; however, in this case, there is some issue with the screen/console configuration and so nothing is printing to the screen at all during boot (although kernel boot messages are being printed to /var/log/kern.log
).
However, the klogd stderr messages that I'm expecting don't seem to be getting printed to that log file.
So, my question is: where are prints to stderr supposed to be going to during the SysVinit boot sequence? Is it possible to redirect all of these to a file? If so, what is the best way to do that in the init scripts?
Thanks in advance!
Edit: Contents of /etc/syslog.conf:
# Begin /etc/syslog.conf
auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *
# End /etc/syslog.conf
boot io-redirection sysvinit stderr
I'm trying to diagnose some boot problems I am having with a custom linux kernel that I have configured and built. I've been digging through some of the source code for klogd, and apparently, if debugging is enabled (via the -d option), it should be printing some error messages to stderr. I know that on a terminal, stderr usually goes to the same place as stdout; however, in this case, there is some issue with the screen/console configuration and so nothing is printing to the screen at all during boot (although kernel boot messages are being printed to /var/log/kern.log
).
However, the klogd stderr messages that I'm expecting don't seem to be getting printed to that log file.
So, my question is: where are prints to stderr supposed to be going to during the SysVinit boot sequence? Is it possible to redirect all of these to a file? If so, what is the best way to do that in the init scripts?
Thanks in advance!
Edit: Contents of /etc/syslog.conf:
# Begin /etc/syslog.conf
auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *
# End /etc/syslog.conf
boot io-redirection sysvinit stderr
boot io-redirection sysvinit stderr
edited Nov 2 '17 at 10:52
Time4Tea
asked Nov 2 '17 at 2:18
Time4TeaTime4Tea
942320
942320
It's system dependent whether boot messages (stdout and stderr) are printed to a serial port, for example. For the log files, I think you should include your/etc/rsyslog.conf
.
– Philippos
Nov 2 '17 at 8:48
@Philippos: Just added the contents of my /etc/syslog.conf (this is a Linux From Scratch installation, so it's unmodified from what is recommended there). However, my understanding was that this file governs what happens to 'system log messages' specifically, not necessarily any print to stderr. I could easily be mistaken though.
– Time4Tea
Nov 2 '17 at 11:02
add a comment |
It's system dependent whether boot messages (stdout and stderr) are printed to a serial port, for example. For the log files, I think you should include your/etc/rsyslog.conf
.
– Philippos
Nov 2 '17 at 8:48
@Philippos: Just added the contents of my /etc/syslog.conf (this is a Linux From Scratch installation, so it's unmodified from what is recommended there). However, my understanding was that this file governs what happens to 'system log messages' specifically, not necessarily any print to stderr. I could easily be mistaken though.
– Time4Tea
Nov 2 '17 at 11:02
It's system dependent whether boot messages (stdout and stderr) are printed to a serial port, for example. For the log files, I think you should include your
/etc/rsyslog.conf
.– Philippos
Nov 2 '17 at 8:48
It's system dependent whether boot messages (stdout and stderr) are printed to a serial port, for example. For the log files, I think you should include your
/etc/rsyslog.conf
.– Philippos
Nov 2 '17 at 8:48
@Philippos: Just added the contents of my /etc/syslog.conf (this is a Linux From Scratch installation, so it's unmodified from what is recommended there). However, my understanding was that this file governs what happens to 'system log messages' specifically, not necessarily any print to stderr. I could easily be mistaken though.
– Time4Tea
Nov 2 '17 at 11:02
@Philippos: Just added the contents of my /etc/syslog.conf (this is a Linux From Scratch installation, so it's unmodified from what is recommended there). However, my understanding was that this file governs what happens to 'system log messages' specifically, not necessarily any print to stderr. I could easily be mistaken though.
– Time4Tea
Nov 2 '17 at 11:02
add a comment |
1 Answer
1
active
oldest
votes
According to No. 1 of this question and this answer, boot process stderr and stdout are not captured anywhere by default, unless explicitly redirected to syslog. However, one can use a tool such as bootlogd, a daemon started by sysvinit, to capture these messages.
Such a service would need to start before klogd in your case, which, depending on the distribution, can be achieved with the use of LSB init headers.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401971%2fwhere-does-stderr-go-to-during-boot-sysvinit%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
According to No. 1 of this question and this answer, boot process stderr and stdout are not captured anywhere by default, unless explicitly redirected to syslog. However, one can use a tool such as bootlogd, a daemon started by sysvinit, to capture these messages.
Such a service would need to start before klogd in your case, which, depending on the distribution, can be achieved with the use of LSB init headers.
add a comment |
According to No. 1 of this question and this answer, boot process stderr and stdout are not captured anywhere by default, unless explicitly redirected to syslog. However, one can use a tool such as bootlogd, a daemon started by sysvinit, to capture these messages.
Such a service would need to start before klogd in your case, which, depending on the distribution, can be achieved with the use of LSB init headers.
add a comment |
According to No. 1 of this question and this answer, boot process stderr and stdout are not captured anywhere by default, unless explicitly redirected to syslog. However, one can use a tool such as bootlogd, a daemon started by sysvinit, to capture these messages.
Such a service would need to start before klogd in your case, which, depending on the distribution, can be achieved with the use of LSB init headers.
According to No. 1 of this question and this answer, boot process stderr and stdout are not captured anywhere by default, unless explicitly redirected to syslog. However, one can use a tool such as bootlogd, a daemon started by sysvinit, to capture these messages.
Such a service would need to start before klogd in your case, which, depending on the distribution, can be achieved with the use of LSB init headers.
answered 15 mins ago
novicenovice
636
636
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401971%2fwhere-does-stderr-go-to-during-boot-sysvinit%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It's system dependent whether boot messages (stdout and stderr) are printed to a serial port, for example. For the log files, I think you should include your
/etc/rsyslog.conf
.– Philippos
Nov 2 '17 at 8:48
@Philippos: Just added the contents of my /etc/syslog.conf (this is a Linux From Scratch installation, so it's unmodified from what is recommended there). However, my understanding was that this file governs what happens to 'system log messages' specifically, not necessarily any print to stderr. I could easily be mistaken though.
– Time4Tea
Nov 2 '17 at 11:02