#! /bin/sh # Heavily inspired from /etc/init.d/gpm # # /etc/init.d/freezepatch # ### BEGIN INIT INFO # Provides: freezepatch # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 5 # Default-Stop: 0 1 2 3 6 # Description: Should avoid freezing of the keyboard under X ### END INIT INFO # Source SuSE config . /etc/sysconfig/mouse test "$MOUSE" -a "$GPM_PROTOCOL" || test "$GPM_PARAM" || exit 5 # Shell functions sourced from /etc/rc.status: # rc_check check and set local and overall rc status # rc_status check and set local and overall rc status # rc_status -v ditto but be verbose in local rc status # rc_status -v -r ditto and clear the local rc status # rc_failed set local and overall rc status to failed # rc_failed set local and overall rc status to # rc_reset clear local rc status (overall remains) # rc_exit exit appropriate to overall rc status . /etc/rc.status # First reset status of this service rc_reset start="cat /dev/psaux" PID=`echo $(ps -Af | grep -e ${start}\$ | cut -c5-14)` case "$1" in start) echo -n "Starting $start " # BUG NOTE : I _REALLY_ SHOULD TEST MOUSE VARIABLES HERE if test -n "$PID" then echo -n "RUNNING ON PID $PID" false else openvt -- $start fi rc_status -v ;; stop) echo -n "Shutting down $start " if test -n "$PID" then echo -n "(PID $PID)" kill $PID else echo -n "IT SEAMS ALREADY DEAD" false fi rc_status -v ;; restart) $0 stop $0 start rc_status ;; status) echo -n "Checking for $start (PID $PID)" test -n "$PID" rc_status -v ;; probe) ;; *) echo "Usage: $0 {start|stop|status|restart|probe}" exit 1 ;; esac rc_exit