Running evrouter at boot with init.d, or after xserver starts

Posted by J V on Super User See other posts from Super User or by J V
Published on 2012-11-04T10:24:54Z Indexed on 2012/11/04 11:06 UTC
Read the original article Hit count: 372

Filed under:
|

I'm using evrouter to set up mouse button binds, and init.d to start it.

My init.d file:

#!/bin/bash
#Simple init.d script to run evrouter
### BEGIN INIT INFO
# Provides:              evrouter
# Default-Start:         2 3 4 5
# Default-Stop:          0 1 6
# Short-Description:     Set evrouter bindings
# Description:           Set evrouter bindings at boot time.
### END INIT INFO

config="/opt/hacks/evrouterrc"

case "$1" in
  start|restart|reload|force-reload)
    evrouter -c "$config" /dev/input/event*
    ;;
  stop)
    echo "Evrouter is not a daemon, change settings file at '$config' and restart"
    ;;
  *)
    echo "Usage: $0 start" >&2
    exit 3
    ;;
esac

evrouter however complains that:

evrouter: could not open display "".

If evrouter requires xserver to be up, how do I get init to wait until after xserver starts to run this script?

If xserver restarts will this script run automatically?

Running this with sudo services evrouter start still results in this error, can init.d scripts not tell where my display is?

(Not exactly familiar with init, runlevels, etc)

© Super User or respective owner

Related posts about xorg

Related posts about init