Note that, though procps itself is patched to ignore errors when writing to /proc/sys, the problem here is that the initscript causes the systemd-sysctl service to get triggered, and that does not fail gracefully:
ubuntu@procps:~$ sudo /lib/systemd/systemd-sysctl
Couldn't write '1' to 'kernel/kptr_restrict', ignoring: Permission denied
Couldn't write '4 4 1 7' to 'kernel/printk', ignoring: Permission denied
Couldn't write '1' to 'kernel/yama/ptrace_scope', ignoring: Permission denied
Couldn't write '32768' to 'vm/mmap_min_addr', ignoring: Permission denied
Couldn't write '1' to 'fs/protected_hardlinks', ignoring: Permission denied
Couldn't write '1' to 'fs/protected_symlinks', ignoring: Permission denied
Couldn't write '176' to 'kernel/sysrq', ignoring: Permission denied
ubuntu@procps:~$ echo $?
1
Note that, though procps itself is patched to ignore errors when writing to /proc/sys, the problem here is that the initscript causes the systemd-sysctl service to get triggered, and that does not fail gracefully:
ubuntu@procps:~$ sudo /lib/systemd/ systemd- sysctl kptr_restrict' , ignoring: Permission denied yama/ptrace_ scope', ignoring: Permission denied hardlinks' , ignoring: Permission denied symlinks' , ignoring: Permission denied
Couldn't write '1' to 'kernel/
Couldn't write '4 4 1 7' to 'kernel/printk', ignoring: Permission denied
Couldn't write '1' to 'kernel/
Couldn't write '32768' to 'vm/mmap_min_addr', ignoring: Permission denied
Couldn't write '1' to 'fs/protected_
Couldn't write '1' to 'fs/protected_
Couldn't write '176' to 'kernel/sysrq', ignoring: Permission denied
ubuntu@procps:~$ echo $?
1