/ Published in: Bash
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#! /bin/sh ### BEGIN INIT INFO # Provides: app_d # Required-Start: # Required-Stop: # Should-Start: app_d # Default-Start: 3 # Default-Stop: 1 # Short-Description: provides a daemonlike execution of xyz # Description: provides a daemonlike execution of xyz ### END INIT INFO #VERSION 0.2 #AUTHOR [email protected] start_something(){ #start an application using # & # nohup # ... and so on } stop_something(){ killall process_name } case "$1" in start) start_something ;; stop) stop_something ;; restart|force-reload) stop_something start_something ;; *) echo "missing parameter start | stop | restart" exit 1 ;; esac exit 0