[systemd-devel] Is there a way to change the program name in a service file?
Lennart Poettering
lennart at poettering.net
Mon Dec 31 05:33:26 PST 2012
On Mon, 31.12.12 13:16, Thomas Meyer (thomas at m3y3r.de) wrote:
Heya
> thanks and sorry, I missed that one... It works as described, but I
> still see this in the journal output:
>
> Dec 31 10:39:17 localhost.localdomain java[31708]: INFO: Server started.
>
> Is there a way to change the name shown in the journalctl short output
> mode?
How is this message generated? If it is simply printed to STDOUT/STDERR
of the service, then you can change the identifier via
SyslogIdentifier=. If it is generated directly via the syslog protocol
then it is up to the client to specify the identifier. If the client
does not specify an identifier, then the journal will fill it in
automatically from /proc/$PID/comm of the client. The comm name can only
be changed by the process itself either by writing to /proc/self/comm,
via pthread_setname_np() or by using the PR_SET_NAME prctl. AFAIK Mono
actually does use the prctl to change the name of the process to the
basename of the .exe file. Ideally Java would do the same...
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list