Re: How to add service on system reboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May 26, 2004, at 6:43 PM, Muhammad Rizwan Khan wrote:

I have written a serive in C++,,, it runs as daemon. I always start this
service manually typing this command:
/usr/bin/myservice start
I want to run this service atomatically when system reboots.

Easiest method: echo '/usr/bin/myservice start' >> /etc/rc.local

More involved but more elegant solution:
Create an init script like those found in /etc/rc.d/init.d/. In particular, you'll need the "# chkconfig" and "# description" entries (see /etc/rc.d/init.d/sshd for an example). Then use "chkconfig --add <service name>" to add the init script and "chkconfig <service name> on" to activate the default runlevels.


HTH.

--
Jason Dixon, RHCE
DixonGroup Consulting
http://www.dixongroup.net



--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux