AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-347637

ROODAY's questions

Martin Hope
ROODAY
Asked: 2020-11-28 15:15:44 +0800 CST

如何在 Ubuntu 上安装 gmod 服务器作为系统服务?

  • 1

我在 Ubuntu 18.04 上有一个 GMod 服务器,当我通过./run_gmod.sh(作为拥有文件夹/文件的“蒸汽”用户)运行它时它运行良好,其内容是

#!/bin/sh
/datadrive/srcds/gmod/srcds_run -game garrysmod -console -norestart -strictportbind -port 27015 -tickrate 60 -maxplayers 20 \
        +gamemode terrortown +map ttt_minecraft_b5 \
        +host_workshop_collection 1413001823 \
        +sv_setsteamaccount XXXXXXXXXXXX

但是,我想使用 systemctl 将其安装为服务,以便在启动服务器(Azure VM)时自动启动。我创建了一个包含/etc/systemd/system/gmod.service以下内容的文件:

[Unit]
Description=Gmod Server
After=network.target

[Service]
User=steam
WorkingDirectory=/datadrive/srcds/
ExecStart=/datadrive/srcds/gmod/srcds_run -game garrysmod -console -norestart -strictportbind -port 27015 -tickrate 60 -maxplayers 20 +gamemode terrortown +map ttt_minecraft_b5 +host_workshop_collection 1413001823 +sv_setsteamaccount XXXXXXXXXXXX

[Install]
WantedBy=multi-user.target

但是,当我尝试systemctl start gmod得到的日志时,我很奇怪:

Nov 27 22:54:49 Server1 systemd[1]: Started Gmod Server.                                                                                                                                                                       
Nov 27 22:54:49 Server1 bash[4025]: Auto detecting CPU                                                                                                                                                                         
Nov 27 22:54:49 Server1 bash[4025]: Using default binary: ./srcds_linux                                                                                                                                                        
Nov 27 22:54:52 Server1 bash[4025]: Setting breakpad minidump AppID = 4000                                                                                                                                                     
Nov 27 22:54:52 Server1 bash[4025]: [S_API] SteamAPI_Init(): Loaded 'steamclient.so' OK.                                                                                                                                       
Nov 27 22:54:52 Server1 bash[4025]: Could not find steamerrorreporter binary. Any minidumps will be uploaded in-processapplicationmanager.cpp (3936) : Assertion Failed: CApplicationManager::GetMountVolume: invalid index    
Nov 27 22:54:52 Server1 bash[4025]: CAppInfoCacheReadFromDiskThread took 0 milliseconds to initialize                                                                                                                          
Nov 27 22:54:52 Server1 bash[4025]: Uploading dump (in-process) [proxy '']                                                                                                                                                     
Nov 27 22:54:52 Server1 bash[4025]: /tmp/dumps/crash_20201127225452_4.dmp                                                                                                                                                      
Nov 27 22:54:52 Server1 bash[4025]: success = no                                                                                                                                                                               
Nov 27 22:54:52 Server1 bash[4025]: error:  libcurl.so: cannot open shared object file: No such file or directory                                                                                                              
Nov 27 22:54:52 Server1 bash[4025]: applicationmanager.cpp (3936) : Assertion Failed: CApplicationManager::GetMountVolume: invalid index                                                                                       
Nov 27 22:54:52 Server1 bash[4025]: applicationmanager.cpp (4099) : Assertion Failed: m_vecInstallBaseFolders.Count() > 0                                                                                                      
Nov 27 22:54:52 Server1 bash[4025]: CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)                                                                  
Nov 27 22:54:52 Server1 bash[4025]: [S_API FAIL] Tried to access Steam interface SteamUser020 before SteamAPI_Init succeeded.                                                                                                  
Nov 27 22:54:56 Server1 bash[4025]: applicationmanager.cpp (4099) : Assertion Failed: m_vecInstallBaseFolders.Count() > 0                                                                                                      
Nov 27 22:55:00 Server1 bash[4025]: [S_API] SteamAPI_Init(): Loaded 'steamclient.so' OK.                                                                                                                                       
Nov 27 22:55:00 Server1 bash[4025]: CAppInfoCacheReadFromDiskThread took 0 milliseconds to initialize                                                                                                                          
Nov 27 22:55:00 Server1 bash[4025]: Could not find steamerrorreporter binary. Any minidumps will be uploaded in-processapplicationmanager.cpp (3936) : Assertion Failed: CApplicationManager::GetMountVolume: invalid index    
Nov 27 22:55:00 Server1 bash[4025]: Uploading dump (in-process) [proxy '']                                                                                                                                                     
Nov 27 22:55:00 Server1 bash[4025]: /tmp/dumps/crash_20201127225500_5.dmp                                                                                                                                                      
Nov 27 22:55:00 Server1 bash[4025]: success = no                                                                                                                                                                               
Nov 27 22:55:00 Server1 bash[4025]: error:  libcurl.so: cannot open shared object file: No such file or directory                                                                                                              
Nov 27 22:55:00 Server1 bash[4025]: applicationmanager.cpp (3936) : Assertion Failed: CApplicationManager::GetMountVolume: invalid index                                                                                       
Nov 27 22:55:00 Server1 bash[4025]: applicationmanager.cpp (3936) : Assertion Failed: CApplicationManager::GetMountVolume: invalid index                                                                                       
Nov 27 22:55:00 Server1 bash[4025]: applicationmanager.cpp (4099) : Assertion Failed: m_vecInstallBaseFolders.Count() > 0                                                                                                      
Nov 27 22:55:00 Server1 bash[4025]: CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)                                                                  
Nov 27 22:55:09 Server1 bash[4025]: applicationmanager.cpp (4099) : Assertion Failed: m_vecInstallBaseFolders.Count() > 0                                                                                                      
Nov 27 22:55:09 Server1 bash[4025]: httpclient.cpp (4181) : Assertion Failed: Failed writing http cache file to disk                                                                                                           
Nov 27 23:00:42 Server1 systemd[1]: gmod.service: Current command vanished from the unit file, execution of the command list won't be resumed.   

正常日志,通过run_gmod.sh脚本启动时,如下所示:

Auto detecting CPU
Using default binary: ./srcds_linux
mount.cfg adding path: '/datadrive/srcds/gmod/content/css/cstrike'
Couldn't load shader dll: game_shader_generic_garrysmod_srv.soConVarRef mat_dxlevel doesn't point to an existing ConVar
Game_srv.so loaded for "Garry's Mod"
Setting breakpad minidump AppID = 4000
Initializing Steam libraries for Workshop..
[S_API] SteamAPI_Init(): Loaded 'steamclient.so' OK.
CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
CAppInfoCacheReadFromDiskThread took 2 milliseconds to initialize
[S_API FAIL] Tried to access Steam interface SteamUser020 before SteamAPI_Init succeeded.
WS: Waiting for Steam to log us in..
WS: Fetching collection info...
Processing collection 1413001823...
   Collection 'TGN Reborn Content'
   75 new addons
WS: Finished!

WS: Processing 75 addons...
and then more stuff happens

日志在第二行 ( Using default binary: ./srcds_linux) 之后就出现了分歧,我不明白为什么在运行相同的命令时结果如此不同,只是方式不同。这是 GMod 特有的,还是我的gmod.service文件不正确?我已经尝试过查找,但是将服务器作为服务运行的资源很少,而且.service我发现的示例文件最终会给出类似的错误,所以我认为我应该从头开始。

ubuntu systemd systemctl
  • 1 个回答
  • 536 Views
Martin Hope
ROODAY
Asked: 2020-11-21 09:20:30 +0800 CST

是否可以将磁盘从现货 vm 传输/共享到 Azure 中的常规 vm?

  • 0

我在 Azure 上有一个用于测试游戏服务器的现场 vm,但是当我处于设置过程中时,驱逐/解除分配真的很烦人。是否可以在我进行设置工作时将操作系统和存储磁盘传输到另一个普通 VM,然后稍后再切换回来?2个虚拟机可以同时共享这些磁盘吗?

virtual-machines azure
  • 1 个回答
  • 44 Views
Martin Hope
ROODAY
Asked: 2019-01-14 21:52:12 +0800 CST

究竟什么是“透明反向代理”?

  • 8

几年来,我一直在 DigitalOcean 液滴上将一些服务作为 docker 容器运行,最近我认为是时候将其中一个更新到最新版本了(有问题的服务是 ghost 博客平台)。以前,我的工作设置是使用caddy作为反向代理,所以我可以通过转到blog.mydomain.example. Caddyfile 设置如下所示:

blog.mydomain.example {
    proxy / 192.0.2.5:1268
}

其中 IP:port 是本地 ghost docker 容器的端口。

但是,在将我的 ghost 实例更新到最新版本并保持相同的配置后,我收到了一个奇怪的错误。导航到blog.mydomain.example会加载很长一段时间,然后突然重定向到https://192.0.2.5:2368,这当然不起作用,因为这是我的 droplet 上的本地 IP。在网上搜索了很长时间后,我终于找到了解决方法,需要像这样修改我的 Caddyfile:

blog.mydomain.example {
    proxy / 192.0.2.5:1268 {
        transparent
    }
}

代理的caddy 文档页面有一些关于透明的作用:

透明:通过原始请求中的主机信息,正如大多数后端应用程序所期望的那样。
简写:
header_upstream Host {host}
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-For {remote}
header_upstream X-Forwarded-Proto {scheme}

我还阅读了有关代理类型的这篇文章,但我仍然对使反向代理透明意味着什么以及为什么在这种情况下需要它感到困惑。有人可以解释一下吗?

reverse-proxy
  • 1 个回答
  • 4711 Views
Martin Hope
ROODAY
Asked: 2016-04-07 11:33:00 +0800 CST

如何强制仅从主机名连接到特定端口?

  • 0

我在 nginx 反向代理后面的 Digital Ocean 服务器上运行了一些 dockerized 应用程序,确切地说是:https ://github.com/jwilder/nginx-proxy 。我对其进行了配置,以便 app1.domain.com 转到 app1,app2.domain.com 转到 app2,等等。但是,我注意到如果用户执行 public_ip:port 他们仍然可以连接到我的应用程序,即使对于通过 nginx 配置为需要通过 http 身份验证登录的一种。有没有办法配置 nginx,以便只有它们的主机名将被定向到应用程序,并且公共 ip 的任何端口都被拒绝?

ubuntu
  • 1 个回答
  • 45 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve