Create a server service
Create a server service thats run on the server startup
Bash script
Create a bash script (call it "myservice" or whatever) with 766 permisions, on server folder "/etc/init.d"
#!/bin/bash case "$1" in start) echo -n "[....] Starting service: myservice" # ... sleep 1 && echo -e "\e[0K\r[ \e[32mok\e[39m ]" ;; stop) echo -n "[....] Stopping service: myservice" # ... sleep 1 && echo -e "\e[0K\r[ \e[32mok\e[39m ]" ;; restart) echo -n "[....] Restarting service: myservice" # ... sleep 1 && echo -e "\e[0K\r[ \e[32mok\e[39m ]" ;; *) echo "Usage: /etc/init.d/myservice {start|stop|restart}" exit 1 ;; esac exit 0
Shell
Start or Stop the service from the shell
service myservice start service myservice stop service myservice restart