INADYN service file

I have this in my file named inadyn in the /etc/init.d directory:

#!/bin/bash

case "$1" in
    start)
        inadyn
        ;;
    stop)
        (whatever commands you would use to stop the service)
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 start|stop|restart|reload"
        exit 1
esac
exit 0

When I type “service inadyn start” it starts up just fine (I have my config file in /etc/inadyn.conf). The problem is that it stays active in my shell session. It doesn’t start as a service and bring me back to my prompt. It’s like I’m running a regular shell script that I have to ctrl+c to get out of it. What needs to happen to make it really act like a service?

Read about using the startproc and killproc utility programs for handling server processes properly. man startproc

Somebody will suggest running the process asynchronously with &, and it will sort of work, but I recommend doing a proper job with start/killproc.

Oh, and you should follow the layout of /etc/init.d/skeleton for your init script and install it the way recommended. If not, your symlink in a runlevel directory is liable to get deleted the next time SuSEconfig is run.