UnixPedia : HPUX / LINUX / SOLARIS: HPUX : Creating Custom Startup Scripts

Saturday, February 1, 2014

HPUX : Creating Custom Startup Scripts

1.cp /sbin/init.d/template/sbin/init.d/myservice
2.vi /sbin/init.d/myservice
          a. Edit start_msgstatement
          b. Edit stop_msgstatement
          c.Edit start statement
             i. Change CONTROL_VARIABLEto MYSERVICE
             ii. Add command to start your service
              iii. Add command set_return
          d. Edit stopstatement
              i. Change CONTROL_VARIABLEto MYSERVICE
              ii. Add command to stop your service
              iii. Add command set_return

3.vi /etc/rc.config.d/myservice
             a. Add single line, MYSERVICE=1


4. link creation from rc.
 ln-s /sbin/init.d/myservice/sbin/rc3.d/S900myservice
 ln-s /sbin/init.d/myservice/sbin/rc2.d/K100myservice

No comments:

Post a Comment