When the environment variables are set in custom 66 service files, a bug occurs where the last 2 chars (ignoring spaces) of each line are repeated. Obviously, this causes issues with some running services. This happens on both of my devices, so it doesn't seem like it's just something I messed up.

e.g.
My monero@ service file:
[main]
@ type=longrun
@ version=0.0.1
@ description="The secure, private, untraceable peer-to-peer currency"
@ user=( magicalsenpai )
@ options=( log env )

[start]
@ execute=( execl-cmdline -s { monerod --config-file ${conf} --data-dir ${data} ${cmd_args} } )

[stop]
@ execute=( execl-cmdline -s { mpd --kill } )

[environment]
conf = !/home/magicalsenpai/.config/bitmonero/monerod.conf
data = !/home/magicalsenpai/.config/bitmonero
cmd_args = !--max-concurrency 16 --log-level 4
66-intree -g crypto
Name         : crypto
Initialized   : yes
Enabled      : yes
Starts after : user-audio graphics user-net
Current      : no
Allowed      : magicalsenpai
Symlinks     : svc->source db->source
Contents     : /
               ├─(19005,Enabled,longrun) monero@ magicalsenpai-log
               └─(2312,Enabled,longrun) monero@ magicalsenpai
66-inservice -g monero@ magicalsenpai
Name                  : monero@ magicalsenpai
Version               : 0.0.1
In tree               : crypto
Status                : enabled, up (pid 4245) 0 seconds
Type                  : longrun
Description           : A music player daemon
Source                : /home/magicalsenpai/.66/service/monero@ magicalsenpai
Live                  : /run/66/tree/1000/crypto/servicedirs/monero@ magicalsenpai
Dependencies          : /
                        └─(19005,Enabled,longrun) monero@ magicalsenpai-log
External dependencies : None
Optional dependencies : None
Start script          :  execl-cmdline -s { monerod --config-file ${conf} --data-dir ${data} ${cmd_args} }
Stop script           :  execl-cmdline -s { mpd --kill }
Environment source    : /home/magicalsenpai/.66/conf/monero@ magicalsenpai/0.0.1
Environment file      : conf=!/home/magicalsenpai/.config/bitmonero/bitmonero.confnf
                        data=!/home/magicalsenpai/.config/bitmoneroro
Log name              : monero@ magicalsenpai-log
Log destination       : /home/magicalsenpai/.66/log/monero@ magicalsenpai
Log file              :
2020-12-18 17:51:03.646823505  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:04.680354557  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:05.713860671  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:06.747437709  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:07.781807494  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:08.815302648  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:09.849700826  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:10.883935828  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:11.917174952  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:12.951581886  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:13.985680292  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:15.019311341  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:16.053276006  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:17.087674023  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:18.121933020  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:19.155708089  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:20.189340822  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:21.222613869  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
2020-12-18 17:51:22.256632425  Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.confnf
The entire log file is that line repeated, fyi


EDIT: Just realised I had an error in the [stop] section, it was killing mpd instead of monero. It's unrelated to the bug, just wanted to get it out of the way.
What would be the exact command line if you were to run this manually, and what is the output?

Usually there is a -c config.conf ... but I've never used this. It seems like an interesting bug, if it was .conf.conf it would have been more manageable but .confnf .. very strange.
Thanks for the report, really appreciated.
This is clearly a bug, please let me the time to fix it.
fungal_net wroteWhat would be the exact command line if you were to run this manually, and what is the output?
Running the same command manually
monerod --config-file ~/.config/bitmonero/monerod.conf --data-dir ~/.config/bitmonero --max-concurrency 16 --log-level 4 --log-file ~/.config/bitmonero/bitmonero.log
runs successfully and finds each file. Don't really want to post the log, since the daemon logs every couple milliseconds, lmao, so it's already 3000 lines of relatively useless information.

But the error occurs regardless of the service. For example, my ipfs service brings the same error if I add the environment section. Though I can still use the services, since the obvious workaround is just not using the environment section.

@ Eric
Take all the time you need, it's not a critical bug. I'm also happy to provide any additional info you might need
[environment]
conf = !/home/magicalsenpai/.config/bitmonero/monerod.co


2020-12-18 21:51:22.256632425 Can't find config file /home/magicalsenpai/.config/bitmonero/bitmonero.coco
:)

Edit:
I did the same and changed anything I could possibly change, even made a root version of it, and although I have my own services that I've used without a problem ... I don't know, it is the name, the series of --config-.... that creates it, it is doing the same exact thing confnf and moneroro I added spaces, I removed exclamation marks, ... it still gives the same.

Very strange
@ magicalsenpai
please sync and update and confirm us if the bug is fixed (or not :)).
Synced and updated, restarted the services, rebooted to be sure, and deleted and rebuilt the tree. The bug is sadly still present.
Ok, i think i got it. So sync and update.
Also, do not forget to use the -C option at enable time to be sure to rewrite the configuration file.

Please confirm us if the bug is fixed.
Thanks for your report.

I don't know why you use instantiated service but you don't get any advantages with you current frontend file definition. If you want to:
[main]
@ type=longrun
@ version=0.0.1
@ description="The secure, private, untraceable peer-to-peer currency"
@ user=( @ I )
@ options=( log env )

[start]
@ execute=( execl-cmdline -s { monerod --config-file ${conf} --data-dir ${data} ${cmd_args} } )

[stop]
@ execute=( execl-cmdline -s { mpd --kill } )

[environment]
conf = !/home/@ I/.config/bitmonero/monerod.conf
data = !/home/@ I/.config/bitmonero
cmd_args = !--max-concurrency 16 --log-level 4
Every '@ I' will be replaced by 'magicalsenpai' at enable time when you do 66-enable monero@ magicalsenpai. So, now your service is portable between user and you can do e.g. 66-enable monero@ <new_user>.
That's good to know, thanks. It's probably gonna be quite a while before I'm competent in 66.

Powered by Obarun