mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-22 20:47:28 +01:00
change usage
This commit is contained in:
@@ -676,9 +676,15 @@ namespace Tgstation.Server.Host.Components
|
||||
if (!systemIdentity.CanCreateSymlinks)
|
||||
throw new InvalidOperationException($"The user running {Constants.CanonicalPackageName} cannot create symlinks! Please try running as an administrative user!");
|
||||
|
||||
if (systemIdentity is PosixSystemIdentity posixIdentity && posixIdentity.IsRoot())
|
||||
if (!platformIdentifier.IsWindows && systemIdentity.IsSuperUser!.Value)
|
||||
{
|
||||
logger.LogWarning("TGS is being run as the root account. This is not recommended and may prevent launch in a future version.");
|
||||
if (systemIdentity.IsSuperUser is not { } superUser)
|
||||
{
|
||||
throw new InvalidOperationException("Failed to determine if running as root.");
|
||||
}
|
||||
|
||||
if (superUser)
|
||||
logger.LogWarning("TGS is being run as the root account. This is not recommended and may prevent launch in a future version.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user