我有多个.NET核心程序在Ubuntu背景下使用supervisord运行(见下文)。supervisord.conf位于Hello文件夹中。
[program:hello-world-1]
command = /all-hello-worlds/dotMemory-Cli-Linux/tools/dotMemory.sh start-net-core --service-input=null --trigger-max-snapshots=5 --trigger-delay=2m --trigger-timer=00:01:00 Hello-World-1.dll
directory = /all-hello-worlds/Hello-World-1
autostart = true
autorestart = unexpected
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0在每个supervisord.conf中,我使用:dotMemory.sh start-net-core --trigger-delay=1m --trigger-timer=00:00:10 ./HelloWorld.dll
当监督员在后台运行.NET核心程序时,我可以看到dotMemory打印消息,上面写着“按下Ctrl+C以结束分析”
这些.NET核心程序被捆绑在一个Dorker容器中,该容器运行/usr/bin/supervisord -c /all-hello-worlds/supervisord.conf
下面是另一个名为supervisord.conf的supervisord.conf,它位于all-hello-worlds文件夹中
; supervisor config file
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
nodaemon = true ; run in the background aka daemonizing
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /all-hello-worlds/*/supervisord.conf您可以将Ubuntu中的文件夹结构可视化如下:
all-hello-worlds (root folder)
| --- dotMemory-Cli-Linux
| --- supervisord.conf
| --- Hello-World-1
| --- Hello-World-1.dll
| --- supervisord.conf
| --- Hello-World-2
| --- Hello-World-2.dll
| --- supervisord.conf现在,我很难发送Ctrl命令来监督Hello进程。如果我使用supervisorctl stop Hello-World-1,则dotMemory没有正确保存DMW文件&我需要使用dotMemory recover方法来获取DMW文件(这很麻烦)
如果我使用kill -SIGINT [dotMemory process ID],监控程序将重新启动进程&没有正确保存DMW文件。
是否有将Ctrl命令发送到具有supervisord的后台运行的dotMemory?我已经在这里附加了两个supervisord.conf文件。
如果你需要我更多的信息,请告诉我。谢谢。
发布于 2021-07-28 12:07:31
您使用的是通过mono运行的旧dotMemory控制台版本。kill -SIGINT [dotMemory process ID]命令不能正常工作。
但是,可以通过文件将##dotMemory["disconnect"]发送到stdin:
--service-input参数修改命令行:dotMemory.sh start-net-core --service-input=<Path to service messages file>/dotMemoryInput.txt
当您想要停止分析会话时,编辑文件:
echo '##dotMemory["disconnect"]' >> <Path to service messages file>/dotMemoryInput.txt
在这种情况下,分析会话将完成,工作区将被保存。
另一种方法是将dotMemory clt版本更新为2021.1.5。由于2021.1 dotMemory通过dotnet运行,并且kill -SIGINT [dotMemory process ID]与此版本一起正常工作,因此成功地保存了工作区。
https://stackoverflow.com/questions/68545683
复制相似问题