5

I am searching all over internet but could not find any information about INVALIDARGUMENT .

After stopping service in systemd, I got this response.

Oct 18 21:17:04 BSU00383 systemd: Stopping filebeat...
BUNCH OF APPLICATION ERROR HERE
Oct 18 21:17:04 BSU00383 systemd: filebeat.service: main process exited, code=exited, status=2/INVALIDARGUMENT

It looks like the application side failed to process the SIGTERM signal before receiving SIGKILL signal from systemd but in what situations does systemd returns INVALIDARGUMENT in general?

I am using Red Hat Enterprise Linux 7.4 .

I appreciate if some one can help me out...

Thanks,

Yu Watanabe

1 Answer 1

6

The "INVALIDARGUMENT" name is a "code" for exit status 2.

In systemd source code (looking at v219, which is the version shipped with RHEL 7), there's a constant for it defined in enum ExitStatus:

EXIT_INVALIDARGUMENT = 2,

These constants seem to come from the LSB standard (which tried to standardize init scripts, when init scripts used to be a thing...)

Looking at the relevant section of LSB, there's this table:

1      generic or unspecified error (current practice)
2      invalid or excess argument(s)
3      unimplemented feature (for example, "reload")
4      user had insufficient privilege
5      program is not installed
6      program is not configured
7      program is not running

Which matches the other systemd constants... So it seems systemd tried to use the LSB standard, since there's some small benefit for programs following this standard.

Of course, not all programs follow this standard, so systemd might end up telling what it thinks that error code means, even though program authors might have decided to use exit status 2 (and others through 7) for completely different purposes...

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .