大网数据广告活动
服务器运维问答

What does INVALIDARGUMENT mean?

· 52CE 我爱测

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…

问题原文

原帖链接 · Yu Watanabe · CC BY-SA 4.0

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

已采纳解答

原帖链接 · filbranden · CC BY-SA 4.0

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...

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-11-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。