supervisor crash when config command include java "%t %p" variable

Created on 22 Aug 2017  路  2Comments  路  Source: Supervisor/supervisor

os: CentOS6.5 x64
python: 2.6.6
version: 3.3.3
java:1.8
I use supervisor run java app, when supervisor config file command include -Xloggc:/tmp/jvm_gc_%t_%p.log,
%t and %p make supervisor crash,
%t and %p is JDK internal environment variable,the filename is jvm_gc_2017-08-18_17-50-30_pid6511.log.

question

Most helpful comment

supervisord doesn't crash, it prints an error message and exits. If you don't see the error message, try running it with the nodaemon option.

Error: Format string 'java -Xloggc:/tmp/jvm_gc_%t_%p.log hello.java' for 'program:java.command' is badly formatted: unsupported format character 't' (0x74) at index 26 in section 'program:java' (file: 'supervisord.conf')

supervisord uses the % character for its own format strings in the config file. You can still use the % character but you must escape it like %%:

command = java -Xloggc:/tmp/jvm_gc_%%t_%%p.log

All 2 comments

supervisord doesn't crash, it prints an error message and exits. If you don't see the error message, try running it with the nodaemon option.

Error: Format string 'java -Xloggc:/tmp/jvm_gc_%t_%p.log hello.java' for 'program:java.command' is badly formatted: unsupported format character 't' (0x74) at index 26 in section 'program:java' (file: 'supervisord.conf')

supervisord uses the % character for its own format strings in the config file. You can still use the % character but you must escape it like %%:

command = java -Xloggc:/tmp/jvm_gc_%%t_%%p.log

when I run supervisor with the nodaemon option,I see the error message:
Starting supervisord: Error: Format string '/usr/local/jdk/bin/java -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Xms2g -Xmx2g -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/jvm_gc_%t_%p.log -jar xxx.jar' for 'program:xxx.command' is badly formatted: unsupported format character 't' (0x74) at index 179 in section 'program:xxx' (file: '/etc/supervisord.d/xxx.ini')
For help, use /usr/bin/supervisord -h

%% solved my problem,thank you!

Was this page helpful?
0 / 5 - 0 ratings