I'm using the sh -c exec idiom in an ExecStart statement (in a service unit file) to interpolate some shell commands. For example:
ExecStart=/bin/sh -ec "exec /usr/bin/foo $(/usr/bin/foo-config)"
It works great. However, when I look at the journal for this service, the process name is sh instead of foo. Is there a way to lie about the process name using this idiom?
sh -ec "exec whatever" desired-name. It will be set as$0for the shell. Not sure if it will carry through to where you want it but it's a good bet.