Ubuntu Notes

From Supernifty
Revision as of 01:35, 10 October 2008 by Wiki (talk | contribs) (New page: Various tips tricks and methods for administering Ubuntu. == Startup Scripts == === Format === #!/bin/sh case "$1" in start) echo "starting service..." # start stuff ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Various tips tricks and methods for administering Ubuntu.

Startup Scripts

Format

#!/bin/sh
case "$1" in
   start)
     echo "starting service..."
     # start stuff
     echo "Started."
     ;;
   stop)
     echo "stopping service..."
     # stop stuff
     echo "stopped service."
     ;;
   *)
     echo "Usage: /etc/init.d/service {start|stop}"
     exit 1
     ;;
 esac
 exit 0

Installing

sudo cp service.sh /etc/init.d
sudo chmod 755 /etc/init.d/service.sh
sudo update-rc.d service.sh defaults

Uninstalling

sudo rm /etc/init.d/service.sh
sudo update-rc.d service.sh remove