LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   add service to "system services list"? (https://www.linuxquestions.org/questions/linux-software-2/add-service-to-system-services-list-165759/)

frieza 04-03-2004 12:03 PM

add service to "system services list"?
 
two questions about the following script i created

Code:

#!/bin/bash
test=$1
if [ "$test" = "start" ]
    then
    /usr/local/sbin/LCDd -d MtxOrb&
    sleep 1
    /usr/bin/mtxorb /dev/lcd
    sleep 1
    /usr/local/bin/lcdproc K -d
else
    if [ "$test" = "stop" ]
        then
        killall lcdproc
        killall LCDd
    else
        if [ "$test" = "restart" ]
            then
            killall lcdproc
            sleep 1
            killall LCDd
            sleep 1
            /usr/local/sbin/LCDd -d MtxOrb&
            sleep 1
            /usr/bin/mtxorb /dev/lcd
            sleep 1
            /usr/local/bin/lcdproc K -d
        else
            echo restart start or stop
        fi
    fi
fi

the purpose is to start and stop LCDd and a clock lcdproc client

first question, how could this perhaps be made more efficient

second of all, i put it in /etc/rc.d/init.d and linked it to the proper names in the /etc/rc.d/rcX.d directories, how do i get it to appear under "system services" within the "setup" program so it can start and stop on runlevel change?

opps, third, how do i get it to say
starting lcd [ OK ] or [ FAIL ]
and
stoping lcd [ OK ] or [ FAIL ]

when invoked?

AutOPSY 04-03-2004 01:15 PM

the file /etc/rc.d/rc.sysinit has all that ok/failed stuff,

shuffle it into there or put it into rc.5.

tkdave 05-05-2004 11:51 AM

chkconfig --add servicename
 
that rc[X].d stuff is for chkconfig
the setup program is a front for chkconfig
try...

chkconfig --add servicename

where servicename is the name of the script you added to /etc/rc.d/init.d

not sure about the [ok] stuff.

chkconfig --help is useful.


All times are GMT -5. The time now is 11:29 PM.