Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all, I am using linux service to start a program. However different behaviors are observed when the service is started automatically upon startup/reboot and when the service is called ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    2

    Post Stange behaviour noted when using service

    Hi all,

    I am using linux service to start a program. However different behaviors are observed when the service is started automatically upon startup/reboot and when the service is called manually through "service myservice start".

    Script to startup my program(Name:myprog)
    -----------------------------------------------------------
    1 while(application is down)
    2 do
    3 "start my application" #script will stop here if program is running(script can still be found when i perform a "ps"
    4 echo "rebooting" >> log.txt
    5 done

    Startup script(Name:myservice)
    -----------------------------------------------------------
    Simply call myprog


    Via startup/reboot
    ------------------------------------------------------------
    The application gets started however, in the event when the application crashes, the script will terminate at line 3 instead of printing out "rebooting" in log.txt. When i perform a "ps", both the script and program can no longer be found.

    Via manual startup-"service myservice start"
    ------------------------------------------------------------
    The application also gets started. However when the application crashes, the same script continue with line 4 and "rebooting" is printed in log.txt. When i perform a "ps",both the script and program can still be found.

    I have done all the necessary setup, eg creating a service script(myservice) in /etc/init.d, and adding it using chkconfig.

    Sorry for the long post.

    Any help is greatly appreciated! Please advise.

    Cheers!

  2. #2
    Just Joined!
    Join Date
    Mar 2009
    Posts
    2
    please advise...thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...