Run a script when the system starts up or reboots on Ubuntu.
1) Create script, on this example I'm starting the gluu-server service as the root user
$sudo nano /etc/init.d/MyScriptName
Copy/paste the following script, update accordingly:
#! /bin/sh
# /etc/init.d/MyScriptName
#
case "$1" in
start)
echo "Attempting to Start Gluu Server..."
sudo -H -b service gluu-server start
;;
stop)
echo "Attempting to Stop Gluu Server..."
sudo -H service gluu-server stop
;;
*)
echo "Usage: /etc/init.d/MyScriptName {start|stop}"
exit 1… Read more
1) Create script, on this example I'm starting the gluu-server service as the root user
$sudo nano /etc/init.d/MyScriptName
Copy/paste the following script, update accordingly:
#! /bin/sh
# /etc/init.d/MyScriptName
#
case "$1" in
start)
echo "Attempting to Start Gluu Server..."
sudo -H -b service gluu-server start
;;
stop)
echo "Attempting to Stop Gluu Server..."
sudo -H service gluu-server stop
;;
*)
echo "Usage: /etc/init.d/MyScriptName {start|stop}"
exit 1… Read more