[Bug 1247921] Re: starting procps getting invalid argument setting key
Peter Cordes
peter at cordes.ca
Tue Nov 26 15:04:37 UTC 2013
I ran into this today, and eventually (thanks to strace!) figured out
that I had a config file that didn't end with a newline. So what was
getting fed to sysctl was actually
fs.inotify.max_user_watches = 65536fs.inotify.max_user_watches = 65536
(yes, two files in a row were setting the same value, but the first one
didn't end with a newline).
So sysctl opened /proc/sys/fs/inotify/max_user_watches, and wrote
"65536fs.inotify.max_user_watches = 65536" to it. Then printed an
error, and exited with a non-zero status, making the upstart job fail.
So, biggest problem here is that the upstart job shouldn't fail if you
have one bad line in one config file. warning somehow would be
excellent, but I think most people would rather not have their whole
package upgrade chain blocked while they sort this out.
Admittedly, I probably wouldn't have noticed it at all if it hadn't
blocked dpkg, and I was only ok because other lines were also setting
the same key. If this had been something important for security, I
might not be arguing that the upstart job should be cat | sysctl; true
Printing the key value would probably be a good idea, too, that would
have saved me a bunch of debugging after I found where upstart stores
its scripts and logs. (I feel old for being used to good old init.d
scripts that I could run manually to see their output... Hey upstart,
get off of my lawn. Although honestly the format of the files in
/etc/init/ is very easy to understand, I found the script portion
without any trouble so I could still just run what the script was trying
to do.)
I tried a bunch of different inputs to sysctl, including noticing that
I got no errors if I fed it the config files one at a time with for i in
/etc/sysctl.d/* /etc/sysctl.conf; do echo $i;sudo sysctl -e -p
"$i";done. As I said, I didn't figure out that I had a file not ending
in newline until I ran cat ... | sudo sysctl -e -p - 2>&1 | less
I feel like this could have been a lot easier to debug with better
error messages, even leaving aside that I had to learn my way around
upstart at the beginning of this. Oh, and to figure out that the procps
postinst script was trying to start an upstart job called procps. I
wasn't 100% sure from the error messages. (although now that I look at
the invoke-rc.d line, it does say it was the procps init script.)
So, bottom line, procps init script should probably not fail when the
only errors are invalid values for keys. It already ignores unknown
keys, with the -e option. Maybe sysctl needs an option to ignore errors
of the other kind? Although if a key exists, errors assigning to it are
much more likely to be a problem, so you do want to at least warn, but
don't want to ignore them or trainwreck.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to procps in Ubuntu.
https://bugs.launchpad.net/bugs/1247921
Title:
starting procps getting invalid argument setting key
Status in “procps” package in Ubuntu:
New
Bug description:
On Ubuntu 12.04, I am not able to update procps with:
<code>
globen:~# apt-get -y --force-yes install --reinstall procps
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
procps
1 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.
Need to get 0 B/225 kB of archives.
After this operation, 0 B of additional disk space will be used.
Reading changelogs... Done
apt-listchanges: Mailing root: apt-listchanges: changelogs for globen.vih.dk
(Reading database ... 49116 files and directories currently installed.)
Preparing to replace procps 1:3.2.8-11ubuntu6 (using .../procps_1%3a3.2.8-11ubuntu6.2_i386.deb) ...
Unpacking replacement procps ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Setting up procps (1:3.2.8-11ubuntu6.2) ...
start: Job failed to start
invoke-rc.d: initscript procps, action "start" failed.
dpkg: error processing procps (--configure):
subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
</code>
When trying to start procps, I get:
<code>
globen:~# service procps start
start: Job failed to start
globen:~# tail /var/log/upstart/procps.log
error: "Invalid argument" setting key "kernel.pid_max"
</code>
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/procps/+bug/1247921/+subscriptions
More information about the foundations-bugs
mailing list