I want to run a c++ program that is using POSIX threads on openSUSE 12 as a daemon, and be able start, stop and restart it as a service with a normal init.d script based on this template: http://www.novell.com/coolsolutions/feature/15380.html.
It turns out however that startproc and killproc are not good for handling kernel threads (which POSIX threads apparently are). I manage to start the program with startproc, but it is not recognized and killed by killproc. The rc_status returns a red "failed" when running startproc even if the program actually is started, and it returns green "done" when running killproc even if it is not killing the process.
Is there an alternative to using startproc/killproc on openSUSE 12? If one starts the service with a simple nohup, how is it then normally stopped? By just killing it? What is in that case a good way of acquiring the pid needed by "kill"?