<div dir="ltr"><div class="gmail_default" style="font-size:large">using the .sh concept:<br># systemctl status coderunner<br>* coderunner.service - The Modern Pascal Code Running Socket Server<br>   Loaded: loaded (/usr/lib/systemd/system/coderunner.service; enabled; vendor preset: disabled)<br>   Active: active (running) since Wed 2020-01-29 10:55:30 EST; 8s ago<br>  Process: 18065 ExecStartPre=/usr/bin/rm -f /run/coderunner2.pid (code=exited, status=0/SUCCESS)<br> Main PID: 18066 (coderunner2.sh)<br>   CGroup: /system.slice/coderunner.service<br>           |-18066 /bin/sh /usr/local/bin/coderunner2.sh<br>           `-18069 /usr/local/bin/coderunner2<br><br>Jan 29 10:55:30 <a href="http://www.modernpascal.com">www.modernpascal.com</a> systemd[1]: Starting The Modern Pascal Code Running Socket Server...<br>Jan 29 10:55:30 <a href="http://www.modernpascal.com">www.modernpascal.com</a> systemd[1]: Started The Modern Pascal Code Running Socket Server.</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">So it starts - telnet 127.0.0.1 - and I get the ???? stuff still.</div><div class="gmail_default" style="font-size:large">cat /etc/test.txt</div><div class="gmail_default" style="font-size:large"><null></div><div class="gmail_default" style="font-size:large">ls -alrt /etc/test.txt</div><div class="gmail_default" style="font-size:large">-rw-r--r-- 1 root root 0 Jan 29 10:54 /tmp/test.txt</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">chmod 777 just incase...</div><div class="gmail_default" style="font-size:large">do not make a different, I even tried, bash, and even added starting...</div><div class="gmail_default" style="font-size:large">#!/bin/bash<br>echo "Starting">>/tmp/test.txt<br>echo "LANG=$LANG" >>/tmp/test.txt<br>echo "LOCALE=$LOCALE" >>/tmp/test.txt<br>export LC_ALL=C<br>/usr/local/bin/coderunner2</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">Nothing writes to the file when systemctl starts it. However, if I ./coderunner2.sh I get:</div><div class="gmail_default" style="font-size:large">Starting<br>LANG=en_US<br>LOCALE=<br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">So, I guess try FPC 3.0.x???<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 29, 2020 at 9:42 AM Nikolai Zhubr via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
29.01.2020 18:07, Ozz Nixon via fpc-devel:<br>
> 1. My code does not directly interact with any environment variables.<br>
<br>
Ok.<br>
<br>
> ExecStart=/usr/local/bin/coderunner2<br>
<br>
I'd suggest, as a quick and horrible temporary hack/test, replace this <br>
direct binary call with a shell wrapper, lets name it e.g. <br>
coderunner2.sh, containing something like:<br>
<br>
#!/bin/sh<br>
echo "LANG=$LANG" >>/tmp/test.txt<br>
echo "LOCALE=$LOCALE" >>/tmp/test.txt<br>
export LC_ALL=C<br>
/usr/local/bin/coderunner2<br>
<br>
(Put it into /usr/local/bin/ as otherwise systemd might refuse it; I <br>
suppose the script is simple enough to be self-explanatory)<br>
<br>
> 3. I do not see anything in that file that would override socket output.<br>
<br>
Sure.<br>
<br>
> 5. per wireshark, tcpdump (if the same) - it shows '?' is being sent<br>
> when the daemon is managed by systemctl, and the expected 8bit is sent<br>
> when ran at the shell prompt.<br>
<br>
That proves the problem is unrelated to sockets. Is is related to <br>
string/encoding handling.<br>
<br>
<br>
HTH...<br>
<br>
Regards,<br>
Nikolai<br>
_______________________________________________<br>
fpc-devel maillist  -  <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" rel="noreferrer" target="_blank">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
</blockquote></div>