Help me see the error of the Service Startup Script

Source: Internet
Author: User
Let me take a look at the error of the Service Startup Script-Linux general technology-Linux programming and kernel information. The following is a detailed description. Run the executable program under/usr/local/bin. d/ypxfrd, slightly changed it, and wrote the following script to run the script (named teststart). An error is reported in red hat 9.0, indicating that the file or directory/etc/rc does not exist. d/init. d/functions! I checked the file in this directory and run ypxfrd using shell. It can be executed normally. but I just modified a few places. the following is my rewritten script. For the first time I wrote this script, there must be other errors. please advise
#! /Bin/bash
#
# Elink DG: Starts the Elink DG
#
# Version: @ (#)/etc/init. d/elinkdg 1.0


# Source function library.
[-F/etc/rc. d/init. d/functions] | exit 0
./Etc/rc. d/init. d/functions

# The application programe path.
# Add sosdairs
[-F/usr/local/bin/elinkdg] | exit 0

RETVAL = 0

Start (){
Echo-n $ "Starting Elink DG server :"
# Modify by sosdairs
# Here has a error? YPXFRD_ARGS?
Daemon elinkdg $ YPXFRD_ARGS
ETVAL = $?
Echo
# Modify by sosdairs
[$ RETVAL-eq 0] & touch/usr/local/bin/elinkdginfo
Return $ RETVAL
}

Stop (){
Echo-n $ "Stopping Elink DG server :"
Killproc elinkdg
RETVAL =$?
# Modify by sosdairs
[$ RETVAL-eq 0] & rm-f/usr/local/bin/elinkdginfo
Echo
Return $ RETVAL
}

# See how we were called.
Case "$1" in
Start)
Start
;;
Stop)
Stop
;;
Status)
Status rpc. ypxfrd
;;
Restart | reload)
Stop
Start
;;
Condrestart)
If [-f/usr/local/bin/elinkdginfo]; then
Stop
Start
Fi
;;
*)
Echo $ "Usage: $0 {start | stop | status | restart | reload | condrestart }"
Exit 1
Esac

Exit $ RETVAL
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.