How to make a program/process a service under SysV-style init?

9,207

From what I found, noip2 includes the script /etc/init.d/noip2, (also here, for those not running Debian right now) which should already be all you need. I'm not sure how services interacts with the scripts in /etc/init.d, but in general you could run

/etc/init.d/noip2 start

to start the noip2 service and

/etc/init.d/noip2 stop

to stop it. Have a look at the script, it shows how to wrap any such process into a system service (with a pidfile, for example) using start-stop-daemon.

Share:
9,207

Related videos on Youtube

Patryk
Author by

Patryk

Software Engineer C++/Go/shell/python coder Linux enthusiast Github profiles: https://github.com/pmalek https://github.com/pmalekn

Updated on September 18, 2022

Comments

  • Patryk
    Patryk over 1 year

    I wonder how can I make a regular application like for instance noip2 updater a system process. I use Debian 6.0.2. For now I have it like this :

    • the binary is in the /usr/local/bin/ as noip2 file
    • the 'script' that launches is added to /etc/rc.local

    How can I make it a system service to be able to run/stop it with e.g. service command ?

    • Admin
      Admin about 12 years
      You should probably tell us (Unix and Linux users) what makes something a "service", and what the "service" command does. I have only a vague idea how that relates to the Unix/Linux idea of a "daemon process".
  • Patryk
    Patryk about 12 years
    Thanks for the reply. As I see noip is not available for squeeze link
  • sr_
    sr_ about 12 years
    Indeed, it has been removed and there is no maintainer. (See also this bug report.) Probably time to (a) take over maintaining the package or (b) look for an alternative.