Previous Page | Next Page

  1. Introduction
  2. Boot Process
  3. Init and System Initialization
  4. rc.sysinit script
  5. rc script
  6. functions script
  7. Services
  8. apm daemon
  9. network startup
  10. The network script file
  11. The network-functions file
  12. Portmap startup
  13. Random initialization
  14. Syslog initialization
  15. Gated
  16. Atd
  17. cron initialization
  18. pcmcia
  19. inetd daemon
  20. named daemon
  21. lpd daemon
  22. mars-nwe
  23. netfs startup
  24. dhcpd daemon
  25. autofs daemon
  26. keytable daemon
  27. sendmail daemon
  28. gpm daemon
  29. httpd daemon
  30. xfs startup
  31. smb startup
  32. innd startup
  33. linuxconf startup
  34. rc.local script
  35. Init, Getty, Login
  36. The shell
  37. Shutting down
  38. X
  39. Conclusions
  40. App A. rc.sysinit listing
  41. App B. functions listing
  42. App C. rc listing
  43. Credits

Linux gpm

The gpm startup script

#!/bin/bash
#
# chkconfig: 2345 85 15
# description: GPM adds mouse support to text-based Linux applications such \
#              the Midnight Commander. Is also allows mouse-based console \
#              cut-and-paste operations, and includes support for pop-up \
#              menus on the console.
# processname: gpm
# pidfile: /var/run/gpm.pid
# config: /etc/sysconfig/mouse

# source function library
. /etc/rc.d/init.d/functions

MOUSECFG=/etc/sysconfig/mouse

RETVAL=0

case "$1" in
  start)
	echo -n "Starting gpm mouse services: "
	if [ -f "$MOUSECFG" ]; then
		. "$MOUSECFG"
	else
		echo "(no mouse is configured)"
		exit 0
	fi

	if [ "$MOUSETYPE" = "none" ]; then
		echo "(no mouse is configured)"
		exit 0
	fi


	if [ "$MOUSETYPE" = "Microsoft" ]; then
		MOUSETYPE=ms
	fi

	if [ -n "$MOUSETYPE" ]; then
		daemon gpm -t $MOUSETYPE
	else
		daemon gpm
	fi
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/gpm
	;;
  stop)
	echo -n "Shutting down gpm mouse services: "
	gpm -k
	RETVAL=$?
	echo -n "gpm"
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/gpm
	echo
	;;
  restart|reload)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  status)
	status gpm
	RETVAL=$?
	;;
  *)
	echo "Usage: gpm {start|stop|status|restart|reload}"
	exit 1
esac

exit $RETVAL