RedHat Linux kernel: kernel es lo mejor?
- andrushok
- Novice


- Registrado: May 21, 2004
- Mensajes: 24
- Status: Offline
He instalado Red Hat 9 en algunos servidor y actualización del núcleo hasta el más reciente versión: kernel-smp-2.4.20-31,9 Algunos mi solicitud ha dejado de funcionar. I depuradas y considerada probem los siguientes:
después de fork () intento de bloqueo de archivos utilizando lockf (). El niño rama I almuerzo la nueva aplicación que utiliza execl (). Por lo general (en cualquier Unix y Red Hat 7.1) el proceso hijo se mantiene el bloqueo. Sin embargo, en este caso el proceso hijo pérdidas y el bloqueo de mi solicitud de trabajo mal.
I núcleo rebajado a kernel-smp-2.4.20-28,9 y la appication comenzó a trabajar bien.
He comprobado la lista de errores en http://www.redhat.com y no encontraron nada al respecto. ¿Sombody oír hablar de este problema?
después de fork () intento de bloqueo de archivos utilizando lockf (). El niño rama I almuerzo la nueva aplicación que utiliza execl (). Por lo general (en cualquier Unix y Red Hat 7.1) el proceso hijo se mantiene el bloqueo. Sin embargo, en este caso el proceso hijo pérdidas y el bloqueo de mi solicitud de trabajo mal.
I núcleo rebajado a kernel-smp-2.4.20-28,9 y la appication comenzó a trabajar bien.
He comprobado la lista de errores en http://www.redhat.com y no encontraron nada al respecto. ¿Sombody oír hablar de este problema?
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Mayo 21st, 2004, 11:34 am
- b_heyer
- Web Master


- Registrado: Jun 15, 2003
- Mensajes: 4583
- Loc: Maryland
- Status: Offline
- andrushok
- Novice


- Registrado: May 21, 2004
- Mensajes: 24
- Status: Offline
¿Qué es el paquete no se me olvida? I downloades RPMs de ftp.redhat.com y lo instaló usando el comando rpm. Yo no compilar núcleos.
He probado el código de
La salida normal es:
Sin embargo, si aplica el nuevo kernel tengo el siguiente:
¿Qué necesito para añadir el nuevo kernel para restablecer el trabajo normal de acuerdo con el estándar POSIX?
He probado el código de
Código: [ Select ]
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
int main( int args, char* argv[])
{
pid_t spid = getpid();
if( args == 1 )
printf( "\n\n[%d]: Parent process started\n", spid);
else if( args == 3 )
{
printf( "[%d]: Child process started\n", spid);
sleep( 15);
printf( "[%d]: Child process done!!!\n", spid);
return 0;
}
pid_t pid = fork();
int status;
switch( pid )
{
case -1:
printf( "[%d] fork failed.\n", spid);
exit( 0);
case 0:
{
pid_t pid = getpid();
printf( "[%d]->[%d] Child forked\n", spid, pid);
int hOutFile = creat( "test.out", S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
| S_IWOTH);
int rl = lockf( hOutFile, F_LOCK, 100);
if( !rl )
printf( "[%d]->[%d] File 'test.out' locked\n", spid, pid);
else
{
printf( "[%d]->[%d] File 'test.out' did not lock, process failed\n", spid
, pid);
exit( 0);
}
if( execl( argv[0], argv[0], "-child", "-pending", NULL) == -1 )
{
printf( "[%d]->[%d] Execute '%s' failed\n", spid, pid, argv[0]);
exit( 0);
}
}
default:
printf( "[%d] Parent forked\n", spid);
break;
}
printf( "[%d] Sleep 10 seconds.\n", spid);
sleep( 10);
printf( "[%d] Check lock (should be locked!).\n", spid);
int hOutFile = open( "test.out", O_RDONLY);
int rl = lockf( hOutFile, F_TEST, 100);
printf( "[%d] Lock of file '%d' is %d.\n", spid, hOutFile, rl);
printf( "[%d] Sleep 10 seconds.\n", spid);
sleep( 10);
printf( "[%d] Wake up!, check lock (should be NOT locked!).\n", spid);
rl = lockf( hOutFile, F_TEST, 100);
printf( "[%d] Lock of file '%d' is %d.\n", spid, hOutFile, rl);
printf( "[%d] Parent Done!!!\n", spid);
return 0;
}
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
int main( int args, char* argv[])
{
pid_t spid = getpid();
if( args == 1 )
printf( "\n\n[%d]: Parent process started\n", spid);
else if( args == 3 )
{
printf( "[%d]: Child process started\n", spid);
sleep( 15);
printf( "[%d]: Child process done!!!\n", spid);
return 0;
}
pid_t pid = fork();
int status;
switch( pid )
{
case -1:
printf( "[%d] fork failed.\n", spid);
exit( 0);
case 0:
{
pid_t pid = getpid();
printf( "[%d]->[%d] Child forked\n", spid, pid);
int hOutFile = creat( "test.out", S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
| S_IWOTH);
int rl = lockf( hOutFile, F_LOCK, 100);
if( !rl )
printf( "[%d]->[%d] File 'test.out' locked\n", spid, pid);
else
{
printf( "[%d]->[%d] File 'test.out' did not lock, process failed\n", spid
, pid);
exit( 0);
}
if( execl( argv[0], argv[0], "-child", "-pending", NULL) == -1 )
{
printf( "[%d]->[%d] Execute '%s' failed\n", spid, pid, argv[0]);
exit( 0);
}
}
default:
printf( "[%d] Parent forked\n", spid);
break;
}
printf( "[%d] Sleep 10 seconds.\n", spid);
sleep( 10);
printf( "[%d] Check lock (should be locked!).\n", spid);
int hOutFile = open( "test.out", O_RDONLY);
int rl = lockf( hOutFile, F_TEST, 100);
printf( "[%d] Lock of file '%d' is %d.\n", spid, hOutFile, rl);
printf( "[%d] Sleep 10 seconds.\n", spid);
sleep( 10);
printf( "[%d] Wake up!, check lock (should be NOT locked!).\n", spid);
rl = lockf( hOutFile, F_TEST, 100);
printf( "[%d] Lock of file '%d' is %d.\n", spid, hOutFile, rl);
printf( "[%d] Parent Done!!!\n", spid);
return 0;
}
- #include <fcntl.h>
- #include <unistd.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/wait.h>
- int main( int args, char* argv[])
- {
- pid_t spid = getpid();
- if( args == 1 )
- printf( "\n\n[%d]: Parent process started\n", spid);
- else if( args == 3 )
- {
- printf( "[%d]: Child process started\n", spid);
- sleep( 15);
- printf( "[%d]: Child process done!!!\n", spid);
- return 0;
- }
- pid_t pid = fork();
- int status;
- switch( pid )
- {
- case -1:
- printf( "[%d] fork failed.\n", spid);
- exit( 0);
- case 0:
- {
- pid_t pid = getpid();
- printf( "[%d]->[%d] Child forked\n", spid, pid);
- int hOutFile = creat( "test.out", S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
- | S_IWOTH);
- int rl = lockf( hOutFile, F_LOCK, 100);
- if( !rl )
- printf( "[%d]->[%d] File 'test.out' locked\n", spid, pid);
- else
- {
- printf( "[%d]->[%d] File 'test.out' did not lock, process failed\n", spid
- , pid);
- exit( 0);
- }
- if( execl( argv[0], argv[0], "-child", "-pending", NULL) == -1 )
- {
- printf( "[%d]->[%d] Execute '%s' failed\n", spid, pid, argv[0]);
- exit( 0);
- }
- }
- default:
- printf( "[%d] Parent forked\n", spid);
- break;
- }
- printf( "[%d] Sleep 10 seconds.\n", spid);
- sleep( 10);
- printf( "[%d] Check lock (should be locked!).\n", spid);
- int hOutFile = open( "test.out", O_RDONLY);
- int rl = lockf( hOutFile, F_TEST, 100);
- printf( "[%d] Lock of file '%d' is %d.\n", spid, hOutFile, rl);
- printf( "[%d] Sleep 10 seconds.\n", spid);
- sleep( 10);
- printf( "[%d] Wake up!, check lock (should be NOT locked!).\n", spid);
- rl = lockf( hOutFile, F_TEST, 100);
- printf( "[%d] Lock of file '%d' is %d.\n", spid, hOutFile, rl);
- printf( "[%d] Parent Done!!!\n", spid);
- return 0;
- }
La salida normal es:
Código: [ Select ]
[10314]: Parent process started
[10314]->[10315] Child forked
[10314]->[10315] File 'test.out' locked
[10315]: Child process started
[10314] Parent forked
[10314] Sleep 10 seconds.
[10314] Check lock (should be locked!).
[10314] Lock of file '3' is -1. (!!!!) this is fine!
[10314] Sleep 10 seconds.
[10315]: Child process done!!!
[10314] Wake up!, check lock (should be NOT locked!).
[10314] Lock of file '3' is 0.
[10314] Parent Done!!!
[10314]->[10315] Child forked
[10314]->[10315] File 'test.out' locked
[10315]: Child process started
[10314] Parent forked
[10314] Sleep 10 seconds.
[10314] Check lock (should be locked!).
[10314] Lock of file '3' is -1. (!!!!) this is fine!
[10314] Sleep 10 seconds.
[10315]: Child process done!!!
[10314] Wake up!, check lock (should be NOT locked!).
[10314] Lock of file '3' is 0.
[10314] Parent Done!!!
- [10314]: Parent process started
- [10314]->[10315] Child forked
- [10314]->[10315] File 'test.out' locked
- [10315]: Child process started
- [10314] Parent forked
- [10314] Sleep 10 seconds.
- [10314] Check lock (should be locked!).
- [10314] Lock of file '3' is -1. (!!!!) this is fine!
- [10314] Sleep 10 seconds.
- [10315]: Child process done!!!
- [10314] Wake up!, check lock (should be NOT locked!).
- [10314] Lock of file '3' is 0.
- [10314] Parent Done!!!
Sin embargo, si aplica el nuevo kernel tengo el siguiente:
Código: [ Select ]
[10314]: Parent process started
[10314]->[10315] Child forked
[10314]->[10315] File 'test.out' locked
[10315]: Child process started
[10314] Parent forked
[10314] Sleep 10 seconds.
[10314] Check lock (should be locked!).
[10314] Lock of file '3' is 0. (!!!!) ERROR!
[10314] Sleep 10 seconds.
[10315]: Child process done!!!
[10314] Wake up!, check lock (should be NOT locked!).
[10314] Lock of file '3' is 0.
[10314] Parent Done!!!
[10314]->[10315] Child forked
[10314]->[10315] File 'test.out' locked
[10315]: Child process started
[10314] Parent forked
[10314] Sleep 10 seconds.
[10314] Check lock (should be locked!).
[10314] Lock of file '3' is 0. (!!!!) ERROR!
[10314] Sleep 10 seconds.
[10315]: Child process done!!!
[10314] Wake up!, check lock (should be NOT locked!).
[10314] Lock of file '3' is 0.
[10314] Parent Done!!!
- [10314]: Parent process started
- [10314]->[10315] Child forked
- [10314]->[10315] File 'test.out' locked
- [10315]: Child process started
- [10314] Parent forked
- [10314] Sleep 10 seconds.
- [10314] Check lock (should be locked!).
- [10314] Lock of file '3' is 0. (!!!!) ERROR!
- [10314] Sleep 10 seconds.
- [10315]: Child process done!!!
- [10314] Wake up!, check lock (should be NOT locked!).
- [10314] Lock of file '3' is 0.
- [10314] Parent Done!!!
¿Qué necesito para añadir el nuevo kernel para restablecer el trabajo normal de acuerdo con el estándar POSIX?
Página 1 de 1
Para responder a este tema que necesita para ingresar o registrarse. Es gratis.
Publicar Información
- Total de mensajes en este tema: 3 mensajes
- Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 110 invitados
- No puede abrir nuevos temas en este Foro
- No puede responder a temas en este Foro
- No puede editar sus mensajes en este Foro
- No puede borrar sus mensajes en este Foro
- No puede enviar adjuntos en este Foro
