Duh, you're right. 22 is EINVAL. I've no idea how I managed to conclude that this was EPERM.
Whis is kind of reassuring -- EINVAL is at least a normal error code here.
Did you do update-rc.d -f ondemand remove immediately before running the test?
I found that this is not necessarily enough, because this job will already have started and will be sleeping in the background by the time you get a prompt. Could this be the cause of the problem?
Instead, you either need to explicitly kill it (you may be able to use start-stop-daemon --oknodo --stop --exec /etc/init.d/ondemand), or reboot after removing the job.
Duh, you're right. 22 is EINVAL. I've no idea how I managed to conclude that this was EPERM.
Whis is kind of reassuring -- EINVAL is at least a normal error code here.
Did you do update-rc.d -f ondemand remove immediately before running the test?
I found that this is not necessarily enough, because this job will already have started and will be sleeping in the background by the time you get a prompt. Could this be the cause of the problem?
Instead, you either need to explicitly kill it (you may be able to use start-stop-daemon --oknodo --stop --exec /etc/init. d/ondemand) , or reboot after removing the job.