title: How to send Ctrl-C to dotMemory command line CLI when it runs in background with supervisord?
body: <p>I have multiple .NET Core programs running in a Ubuntu background using supervisord (see below). That supervisord.conf is located in the Hello-World folder.</p>
  <pre><code>[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
  </code></pre>
  <p>In each supervisord.conf, I use:
  <code>dotMemory.sh start-net-core --trigger-delay=1m --trigger-timer=00:00:10 ./HelloWorld.dll</code></p>
  <p>When the supervisord runs the .NET Core programs in the background, I could see the dotMemory printing message saying about &quot;Press Ctrl+C to end the profiling&quot;</p>
  <p>Those .NET Core programmes are bundled in a Dorker container, which runs <code>/usr/bin/supervisord -c /all-hello-worlds/supervisord.conf</code></p>
  <p>Here is another supervisord.conf called <code>supervisord.conf</code> which is located in the <code>all-hello-worlds</code> folder</p>
  <pre><code>; 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 &quot;files&quot; 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
  </code></pre>
  <p>You can visualise the folder structure in Ubuntu as followed:</p>
  <pre><code>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
  </code></pre>
  <p>Now I struggle sending Ctrl-C command to supervisord Hello-World processes. If I use <code>supervisorctl stop Hello-World-1</code>, the dotMemory does not save the DMW file properly &amp; I need to use <code>dotMemory recover</code> method to get the DMW file (which is troublesome)</p>
  <p>If I use <code>kill -SIGINT [dotMemory process ID]</code>, the supervisord restarts the process &amp; does not save the DMW file properly.</p>
  <p>Is there anyway to send Ctrl-C command to dotMemory running in the background with supervisord?
  I have attached 2 supervisord.conf files here.</p>
  <p>Let me know if you need more information from me.
  Thanks.</p>