Daemon Creation

Hello.
Which are the steps to create a daemon process?. I already have the program running in background but I want to “register” it as a service to make easier its invocation with the “service” command.

Something like this:
service myserv start

Thanks in advance

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What are you planning on getting out of it being “registered”? If you
use the template which is ‘/etc/init.d/skeleton’ and then use something
like ‘chkconfig <serviceName> on’ it’ll all be magically available in
Yast should you decide to use that option. I don’t think there is much
to “registration” really.

Good luck.

castord wrote:
> Hello.
> Which are the steps to create a daemon process?. I already have the
> program running in background but I want to “register” it as a service
> to make easier its invocation with the “service” command.
>
> Something like this:
> service myserv start
>
> Thanks in advance
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIva2m3s42bA80+9kRAreiAJ0RJ705aAlp+JUijsI4Hs0YHKQJ1wCdGBcd
VOhA7Q80A4vyHLoq2Rs+dgc=
=ttXk
-----END PGP SIGNATURE-----

Thank you for the quick reply!
I think I still have the “Windows think” :. I’ll try using the template.

service is just a script that does the equivalent of

/etc/init.d/somescript action

when you type

service somescript action

I actually prefer

rcsomescript action

which is a symlink to /etc/init.d/somescript, as you can use bash command completion. service is a RedHatism.

As ab says, there is no “registration”. You just have to write the script abd put in /etc/init.d/ and to use chkconfig to make the symlinks in the relevant runlevel directories.

Hi, I think you may find the following openSuSE informational on init scripts packaging standards very helpful and should point you in the right direction, and ab’s post above also has some good information. From the page:

**This section describes how to name, create, and install init scripts on SUSE Linux. They are LSB compilant, as explained at http://refspecs.freestandards.org/LSB_2.0.1/LSB-generic/LSB-generic/sysinit.html. **

The page is located:

Packaging/SUSE Package Conventions/Init Scripts - openSUSE

thanks to all of you!
I really appreciate it.