Summary: | rc.subr check_pidfile fails to recognise swapped out process | ||
---|---|---|---|
Product: | Base System | Reporter: | Kajetan Staszkiewicz <vegeta> |
Component: | conf | Assignee: | freebsd-rc (Nobody) <rc> |
Status: | New --- | ||
Severity: | Affects Only Me | CC: | jilles |
Priority: | --- | ||
Version: | 10.1-RELEASE | ||
Hardware: | Any | ||
OS: | Any |
Description
Kajetan Staszkiewicz
2017-09-08 16:13:08 UTC
It is expected that ps (or any other tool that lists processes) does not show the command line if it is longer than the value of the kern.ps_arg_cache_limit sysctl (default: 256 bytes) and the process is swapped out. A proper fix is not easy (this would involve not relying on the process list). Apart from the workarounds mentioned in bug #221518, it is possible to increase the sysctl or move configuration data from the command line into a configuration file (if supported by the daemon). Relaying on config parameters being in config file instead of command line is not much of a difference as way more is missing from `ps` output, mainly the primary program/script name. check_pidfile would have to relay only on $interpreter in such case. As for the other solution I suggested in the original ticket, to use daemon(8), I'm not sure anymore if it would help. Daemon(8) might get swapped out too, unless it performs some checks periodically. But if it just waits for a signal, and I see a sigwait in wait_child function in source code, then this approach won't work. (In reply to vegeta from comment #2) Moving parameters to a configuration file helps because short command lines remain visible even if the process is swapped out. That would probably require changes to smokeping itself. As far as I remember running it in slave mode is done without any config file, only via command line parameters. |