[systemd-devel] Is there a way to change the program name in a service file?
Thomas Meyer
thomas at m3y3r.de
Mon Dec 31 05:50:10 PST 2012
Am Montag, den 31.12.2012, 14:33 +0100 schrieb Lennart Poettering:
> 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=.
yes, its a simple service. above option did the trick. many thanks!
> 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
>
More information about the systemd-devel
mailing list