How do I set core_pattern during boot

I want to set core_pattern. Well obviously I do
rparkins64:/home/rparkins # cat /proc/sys/kernel/core_pattern
core
rparkins64:/home/rparkins # echo “core.%h.%p” > /proc/sys/kernel/core_pattern
rparkins64:/home/rparkins # cat /proc/sys/kernel/core_pattern
core.%h.%p
rparkins64:/home/rparkins #

Fine, except that I don’t want to do this every day when I reboot my machine: I want it done at startup. So I put the echo command in /etc/init.d/before.local. It doesn’t work. I tried creating /etc/init.d/rc5.d/K01before and /etc/init.d/rc5.d/S01before and linking them both to /etc/init.d/before.local - still no joy.

Where do I put the echo command to get it executed during startup?

uname -a says Linux rparkins64 3.4.11-2.16-desktop #1 SMP PREEMPT Wed Sep 26 17:05:00 UTC 2012 (259fc87) x86_64 x86_64 x86_64 GNU/Linux
runlevel says N 5
Machine is a DELL Latitude D820 with 64-bit openSUSE 12.2

On 2013-01-10 13:16, richardparkins wrote:
>
> I want to set core_pattern. Well obviously I do
> rparkins64:/home/rparkins # cat /proc/sys/kernel/core_pattern
> core
> rparkins64:/home/rparkins # echo “core.%h.%p” >
> /proc/sys/kernel/core_pattern
> rparkins64:/home/rparkins # cat /proc/sys/kernel/core_pattern
> core.%h.%p
> rparkins64:/home/rparkins #

Please use code tags (# button) and repost the above.

> Fine, except that I don’t want to do this every day when I reboot my
> machine: I want it done at startup. So I put the echo command in
> /etc/init.d/before.local. It doesn’t work. I tried creating
> /etc/init.d/rc5.d/K01before and /etc/init.d/rc5.d/S01before and linking
> them both to /etc/init.d/before.local - still no joy.

What openSUSE version? Or more precissely, are you using systemd or systemv?

12,1 and 12.2 use systemd, and those tricks do not work anymore.


Cheers/Saludos
Carlos E. R.

You do not. You add setting to /etc/sysctl.d.

echo 'kernel.core_pattern = core.%h.%p' > /etc/sysctl.d/core.conf

Or whatever name suits you better. Use ‘sysctl --system’ to load it to avoid reboot.