# HG changeset patch
# User jfp <jf.pieronne@laposte.net>
# Date 1684996238 -7200
#      Thu May 25 08:30:38 2023 +0200
# Node ID 5b6f0875e77a193f7b5c059f4d8a1133987dda1b
# Parent  02957fc24e059b85ef0ea17ceb5db3be960f6592
Add program configuration parameter 'image' default value 'SYS$SYSTEM:LOGINOUT.EXE'

diff --git a/supervisord.conf_template b/supervisord.conf_template
--- a/supervisord.conf_template
+++ b/supervisord.conf_template
@@ -3,6 +3,8 @@
 user = system
 command = dev:[dir]supervisord.com
 [program:firstpgm]
+# default image to loginout
+# image=SYS$SYSTEM:LOGINOUT.EXE
 command=dev:[dir]PGM1.COM
 process_name=PGM1D
 autostart=yes
diff --git a/supervisord.py b/supervisord.py
--- a/supervisord.py
+++ b/supervisord.py
@@ -226,6 +226,7 @@
 class Program(object):
     mbxunt = 0
     name: str
+    image: bytes
     command: bytes
     program_name: bytes
     autostart: bool
@@ -261,6 +262,7 @@
         name: str,
         user: str,
         command: str,
+        image: str,
         process_name: str,
         autostart: bool,
         priority: int,
@@ -283,6 +285,7 @@
     ):
         self.name = name
         self.user = user.encode()
+        self.image = image.encode()
         self.command = command.encode()
         self.process_name = process_name.encode()
         self.autostart = autostart
@@ -425,7 +428,7 @@
 
             pid = PidType(
                 starlet.creprc(
-                    image=b'SYS$SYSTEM:LOGINOUT.EXE',
+                    image=self.image,
                     input=self.command,
                     output=self.stdout_file,
                     error=self.stderr_file,
@@ -911,6 +914,7 @@
             process_name = config[sn]['process_name']
             autostart = config[sn].getboolean('autostart', False)
             command = config[sn].get('command')
+            image = config[sn].get('image', 'SYS$SYSTEM:LOGINOUT.EXE')
             stdout_file = config[sn].get('stdout_file', 'NLA0:')
             stderr_file = config[sn].get('stderr_file', 'NLA0:')
             priority = config[sn].getint('priority', 999)
@@ -931,6 +935,7 @@
                 name=name,
                 user=user,
                 command=command,
+                image=image,
                 process_name=process_name,
                 autostart=autostart,
                 priority=priority,