forked from pool/plymouth
51 lines
1.6 KiB
Diff
51 lines
1.6 KiB
Diff
From: Werner Fink <werner@suse.de>
|
|
Subject: All daemons should call setsid(2) to become a real daemons
|
|
|
|
All daemons should call setsid(2) to become a real daemons without
|
|
controlling terminal. Beside this the old boot log will help for
|
|
debugging and for support.
|
|
|
|
---
|
|
libply/ply-utils.c | 1 +
|
|
main.c | 5 +++--
|
|
2 files changed, 4 insertions(+), 2 deletions(-)
|
|
|
|
--- a/src/libply/ply-utils.c
|
|
+++ b/src/libply/ply-utils.c 2014-02-12 15:05:49.895141867 +0100
|
|
@@ -815,6 +815,7 @@ ply_create_daemon (void)
|
|
|
|
_exit ((int) byte);
|
|
}
|
|
+ setsid();
|
|
close (receiver_fd);
|
|
|
|
handle = calloc (1, sizeof (int));
|
|
--- a/src/main.c
|
|
+++ b/src/main.c 2014-02-12 14:43:49.216569414 +0100
|
|
@@ -639,7 +639,7 @@ get_log_file_for_mode (ply_mode_t mode)
|
|
break;
|
|
case PLY_MODE_SHUTDOWN:
|
|
case PLY_MODE_UPDATES:
|
|
- filename = _PATH_DEVNULL;
|
|
+ filename = PLYMOUTH_LOG_DIRECTORY "/boot.log";
|
|
break;
|
|
default:
|
|
ply_error ("Unhandled case in %s line %d\n", __FILE__, __LINE__);
|
|
@@ -663,7 +663,7 @@ get_log_spool_file_for_mode (ply_mode_t
|
|
break;
|
|
case PLY_MODE_SHUTDOWN:
|
|
case PLY_MODE_UPDATES:
|
|
- filename = NULL;
|
|
+ filename = PLYMOUTH_SPOOL_DIRECTORY "/boot.log";
|
|
break;
|
|
default:
|
|
ply_error ("Unhandled case in %s line %d\n", __FILE__, __LINE__);
|
|
@@ -715,6 +715,7 @@ prepare_logging (state_t *state)
|
|
if (logfile != NULL)
|
|
{
|
|
ply_trace ("opening log '%s'", logfile);
|
|
+ rename(logfile, PLYMOUTH_LOG_DIRECTORY "/boot.olog");
|
|
ply_terminal_session_open_log (state->session, logfile);
|
|
|
|
if (state->number_of_errors > 0)
|