Hello community, here is the log from the commit of package sysvinit checked in at Wed Aug 23 20:50:44 CEST 2006. -------- --- sysvinit/sysvinit.changes 2006-08-21 12:57:37.000000000 +0200 +++ sysvinit/sysvinit.changes 2006-08-22 15:51:06.000000000 +0200 @@ -1,0 +2,5 @@ +Tue Aug 22 15:49:48 CEST 2006 - werner@suse.de + +- More on delayed utmp write: redo the write on telinit q (#148038) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sysvinit.spec ++++++ --- /var/tmp/diff_new_pack.PqHQLX/_old 2006-08-23 20:50:10.000000000 +0200 +++ /var/tmp/diff_new_pack.PqHQLX/_new 2006-08-23 20:50:10.000000000 +0200 @@ -22,7 +22,7 @@ PreReq: coreutils Autoreqprov: on Version: 2.86 -Release: 26 +Release: 28 Summary: SysV-Style init BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: sysvinit-2.86.tar.bz2 @@ -285,6 +285,8 @@ %doc %{_mandir}/man8/startpar.8.gz %changelog -n sysvinit +* Tue Aug 22 2006 - werner@suse.de +- More on delayed utmp write: redo the write on telinit q (#148038) * Mon Aug 21 2006 - werner@suse.de - Make installation work even within chroot and new kernel 2.6.18+ * Fri Aug 18 2006 - werner@suse.de ++++++ sysvinit-2.86-utmp.patch ++++++ --- /var/tmp/diff_new_pack.PqHQLX/_old 2006-08-23 20:50:11.000000000 +0200 +++ /var/tmp/diff_new_pack.PqHQLX/_new 2006-08-23 20:50:11.000000000 +0200 @@ -1,6 +1,6 @@ --- src/init.c -+++ src/init.c 2006-08-18 14:35:59.000000000 +0200 -@@ -107,6 +107,8 @@ sig_atomic_t got_signals; /* Set if we r ++++ src/init.c 2006-08-22 15:04:27.000000000 +0200 +@@ -115,6 +115,8 @@ sig_atomic_t got_signals; /* Set if we r int emerg_shell = 0; /* Start emergency shell? */ int wrote_wtmp_reboot = 1; /* Set when we wrote the reboot record */ int wrote_utmp_reboot = 1; /* Set when we wrote the reboot record */ @@ -9,7 +9,29 @@ int sltime = 5; /* Sleep time between TERM and KILL */ char *argv0; /* First arguments; show up in ps listing */ int maxproclen; /* Maximal length of argv[0] with \0 */ -@@ -1697,6 +1699,8 @@ int read_level(int arg) +@@ -184,6 +186,8 @@ struct { + { "-WU", D_WROTE_UTMP_REBOOT}, + { "-ST", D_SLTIME }, + { "-DB", D_DIDBOOT }, ++ { "-LW", D_WROTE_WTMP_RLEVEL}, ++ { "-LU", D_WROTE_UTMP_RLEVEL}, + { "", 0 } + }; + struct { +@@ -379,6 +383,12 @@ static CHILD *get_record(FILE *f) + case D_DIDBOOT: + fscanf(f, "%d\n", &did_boot); + break; ++ case D_WROTE_WTMP_RLEVEL: ++ fscanf(f, "%d\n", &wrote_wtmp_rlevel); ++ break; ++ case D_WROTE_UTMP_RLEVEL: ++ fscanf(f, "%d\n", &wrote_utmp_rlevel); ++ break; + default: + if (cmd > 0 || cmd == C_EOF) { + oops_error = -1; +@@ -1705,6 +1715,8 @@ int read_level(int arg) } /* Store both the old and the new runlevel. */ @@ -18,7 +40,41 @@ write_utmp_wtmp("runlevel", "~~", foo + 256*runlevel, RUN_LVL, "~"); thislevel = foo; prevlevel = runlevel; -@@ -2223,6 +2227,8 @@ void boot_transitions() +@@ -1905,6 +1917,25 @@ void re_exec(void) + initlog(L_CO, "Attempt to re-exec failed"); + } + ++/* ++ * Redo utmp/wtmp entries if required or requested ++ * Check for written records and size of utmp ++ */ ++static ++void redo_utmp_wtmp(void) ++{ ++ struct stat ustat; ++ const int ret = stat(UTMP_FILE, &ustat); ++ ++ if ((ret < 0) || (ustat.st_size == 0)) ++ wrote_utmp_rlevel = wrote_utmp_reboot = 0; ++ ++ if ((wrote_wtmp_reboot == 0) || (wrote_utmp_reboot == 0)) ++ write_utmp_wtmp("reboot", "~~", 0, BOOT_TIME, "~"); ++ ++ if ((wrote_wtmp_rlevel == 0) || (wrote_wtmp_rlevel == 0)) ++ write_utmp_wtmp("runlevel", "~~", thislevel + 256 * prevlevel, RUN_LVL, "~"); ++} + + /* + * We got a change runlevel request through the +@@ -1936,6 +1967,7 @@ void fifo_new_level(int level) + if (oldlevel != 'S' && runlevel == 'S') console_stty(); + if (runlevel == '6' || runlevel == '0' || + runlevel == '1') console_stty(); ++ if (runlevel > '1' && runlevel < '6') redo_utmp_wtmp(); + read_inittab(); + fail_cancel(); + setproctitle("init [%c]", runlevel); +@@ -2231,6 +2263,8 @@ void boot_transitions() } if (loglevel > 0) { initlog(L_VB, "Entering runlevel: %c", runlevel); @@ -27,8 +83,26 @@ write_utmp_wtmp("runlevel", "~~", runlevel + 256 * oldlevel, RUN_LVL, "~"); thislevel = runlevel; prevlevel = oldlevel; +@@ -2409,6 +2443,7 @@ int init_main() + console_init(); + + if (!reload) { ++ int fd; + + /* Close whatever files are open, and reset the console. */ + close(0); +@@ -2426,7 +2461,8 @@ int init_main() + * Initialize /var/run/utmp (only works if /var is on + * root and mounted rw) + */ +- (void) close(open(UTMP_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0644)); ++ if ((fd = open(UTMP_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0644)) >= 0) ++ close(fd); + + /* + * Say hello to the world --- src/init.h -+++ src/init.h 2006-08-18 14:27:13.000000000 +0200 ++++ src/init.h 2006-08-22 14:29:39.000000000 +0200 @@ -99,6 +99,10 @@ typedef struct _child_ { extern CHILD *family; extern int wrote_wtmp_reboot; @@ -40,8 +114,15 @@ /* Tokens in state parser */ #define C_VER 1 +@@ -120,4 +124,6 @@ extern int wrote_utmp_reboot; + #define D_WROTE_UTMP_REBOOT -7 + #define D_SLTIME -8 + #define D_DIDBOOT -9 ++#define D_WROTE_WTMP_RLEVEL -16 ++#define D_WROTE_UTMP_RLEVEL -17 + --- src/utmp.c -+++ src/utmp.c 2006-08-18 14:38:53.000000000 +0200 ++++ src/utmp.c 2006-08-22 14:28:52.000000000 +0200 @@ -49,6 +49,12 @@ char *line) /* Which line is this */ struct utsname uname_buf; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org