Wrong logging level when signal name (e.g., SIGTERM) is used with normal exit stanza
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
when using "normal exit 0 SIGTERM" in a job, and if the job is killed with SIGTERM, a warning message will appear in dmesg, like
[330159.038611] init: xxxyyyzzz main process (570) killed by TERM signal
If using "normal exit 0 SIGTERM 15" instead, there won't be such warning message when the job is killed with SIGTERM, 15 is the numerical value for SIGTERM, per "man 7 signal"
After reading the code, it looks to me that the issue is:
1. when parsing "normal exit 0 SIGTERM", the numerical value of SIGTERM is left shifted by 8 and then stored in job->class-
http://
2. but when determining the appropriate log level, the value in job->class-
http://
When using "normal exit 0 SIGTERM 15", both "15 << 8" and 15 will be stored in job->class-
http://
and thus later on the code to determine log level works.
Note that "normal exit 0 SIGTERM" works well with "respawn", it is just the logging code has the minor bug said above.