Merge pull request #1275 from bill-auger/patch-createusers-logging

housekeeping - logging for CreateUser Job
This commit is contained in:
Adriaan de Groot 2019-12-02 11:38:34 +01:00 committed by GitHub
commit 7029c427f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,6 +74,8 @@ CreateUserJob::exec()
if ( gs->contains( "sudoersGroup" ) && !gs->value( "sudoersGroup" ).toString().isEmpty() ) if ( gs->contains( "sudoersGroup" ) && !gs->value( "sudoersGroup" ).toString().isEmpty() )
{ {
cDebug() << "[CREATEUSER]: preparing sudoers";
QFileInfo sudoersFi( destDir.absoluteFilePath( "etc/sudoers.d/10-installer" ) ); QFileInfo sudoersFi( destDir.absoluteFilePath( "etc/sudoers.d/10-installer" ) );
if ( !sudoersFi.absoluteDir().exists() ) if ( !sudoersFi.absoluteDir().exists() )
@ -96,6 +98,8 @@ CreateUserJob::exec()
return Calamares::JobResult::error( tr( "Cannot chmod sudoers file." ) ); return Calamares::JobResult::error( tr( "Cannot chmod sudoers file." ) );
} }
cDebug() << "[CREATEUSER]: preparing groups";
QFileInfo groupsFi( destDir.absoluteFilePath( "etc/group" ) ); QFileInfo groupsFi( destDir.absoluteFilePath( "etc/group" ) );
QFile groupsFile( groupsFi.absoluteFilePath() ); QFile groupsFile( groupsFi.absoluteFilePath() );
if ( !groupsFile.open( QIODevice::ReadOnly | QIODevice::Text ) ) if ( !groupsFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
@ -141,6 +145,8 @@ CreateUserJob::exec()
} }
} }
cDebug() << "[CREATEUSER]: creating user";
QStringList useradd { "useradd", "-m", "-U" }; QStringList useradd { "useradd", "-m", "-U" };
QString shell = gs->value( "userShell" ).toString(); QString shell = gs->value( "userShell" ).toString();
if ( !shell.isEmpty() ) if ( !shell.isEmpty() )