Generate pid/arg files after detaching

This commit is contained in:
Kurt Zeilenga 2003-10-10 02:07:24 +00:00
parent a53514078c
commit 81f1a24e1b

View file

@ -178,6 +178,16 @@ int main( int argc, char **argv )
}
/*
* Detach from the controlling terminal
* unless the -d flag is given or in one-shot mode.
*/
#ifndef HAVE_WINSOCK
if ( ! (sglob->no_detach || sglob->one_shot_mode) ) {
lutil_detach( 0, 0 );
}
#endif
if ( slurpd_pid_file != NULL ) {
FILE *fp = fopen( slurpd_pid_file, "w" );
@ -206,15 +216,6 @@ int main( int argc, char **argv )
}
}
/*
* Detach from the controlling terminal
* unless the -d flag is given or in one-shot mode.
*/
#ifndef HAVE_WINSOCK
if ( ! (sglob->no_detach || sglob->one_shot_mode) )
lutil_detach( 0, 0 );
#endif
if ( (rc = lutil_pair( sglob->wake_sds )) < 0 ) {
SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 16 );
rc = 1;