Ubuntu Notes

From Supernifty
Revision as of 07:41, 12 March 2009 by Wiki (talk | contribs)
(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

Updating

apt-get upgrade - to upgrade all to latest

Services

  • /etc/init.d/service_name cmd