From: Frank Brehm Date: Sun, 17 May 2020 09:45:16 +0000 (+0200) Subject: committing changes in /etc after apt run X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=ab771258ca4d25e76608bb7d591cedd3ec049c4d;p=config%2Fbruni%2Fetc-mint-new1.git committing changes in /etc after apt run Package changes: +libg15-1 1.2.7-2ubuntu2 amd64 +libg15daemon-client1 1.9.5.3-8.3ubuntu3 amd64 +libg15render1 1.3.0~svn316-2.3 amd64 --- diff --git a/.etckeeper b/.etckeeper index b8c9a2c..0102d3d 100755 --- a/.etckeeper +++ b/.etckeeper @@ -1269,6 +1269,7 @@ maybe chmod 0644 'default/cron' maybe chmod 0644 'default/cryptdisks' maybe chmod 0644 'default/dbus' maybe chmod 0644 'default/ebtables' +maybe chmod 0644 'default/g15daemon' maybe chmod 0644 'default/google-chrome' maybe chmod 0644 'default/grub' maybe chmod 0755 'default/grub.d' @@ -1933,6 +1934,7 @@ maybe chmod 0755 'init.d/cups-browsed' maybe chmod 0755 'init.d/dbus' maybe chmod 0755 'init.d/dns-clean' maybe chmod 0755 'init.d/ebtables' +maybe chmod 0755 'init.d/g15daemon' maybe chmod 0755 'init.d/gdm3' maybe chmod 0755 'init.d/grub-common' maybe chmod 0755 'init.d/hddtemp' diff --git a/default/g15daemon b/default/g15daemon new file mode 100644 index 0000000..fce56c6 --- /dev/null +++ b/default/g15daemon @@ -0,0 +1,15 @@ +# Defaults for g15daemon initscript + +# SWITCH_KEY selects the key used to switch between client screens +# +# SWITCH_KEY="MR" to use the MR key (on top left) +# SWITCH_KEY="L1 to use the L1 key: the small round key below the LCD + + +SWITCH_KEY="L1" + +# Turn on debugging of g15 init.d and udev scripts +#G15DEBUG="on" + +# Additional options that are passed to the Daemon. +DAEMON_OPTS="" diff --git a/init.d/g15daemon b/init.d/g15daemon new file mode 100755 index 0000000..742e328 --- /dev/null +++ b/init.d/g15daemon @@ -0,0 +1,177 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: g15daemon +# Required-Start: $syslog $local_fs +# Required-Stop: $syslog $local_fs +# Should-Start: $remote_fs +# Should-Stop: $remote_fs +# X-Start-Before: xdm kdm gdm ldm sdm +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: load deamon for Logitech G15 keyboard lcd display +# Description: load deamon for Logitech G15 keyboard lcd display +### END INIT INFO + + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/g15daemon +NAME=g15daemon +DESC=g15daemon + +[ -x "$DAEMON" ] || exit 0 + +# Include g15daemon defaults if available +if [ -f /etc/default/g15daemon ] ; then + . /etc/default/g15daemon +fi + +if [ "$SWITCH_KEY" = "MR" ]; then + DAEMON_OPTS="-s $DAEMON_OPTS" +fi + +set -e + +if [ "$G15DEBUG" = "on" ]; then + +log() { + logger -p daemon.debug -t g15 -- "$*" +} +else + +log() { + true +} + +fi + + + + +wait_for_file() { + local file=$1 + local timeout=$2 + [ "$timeout" ] || timeout=120 + + local count=$(($timeout * 10)) + while [ $count != 0 ]; do + [ -e "$file" ] && return 0 + sleep 0.1 + count=$(($count - 1)) + done + return 1 +} + +load_uinput() { + if [ ! -e /dev/input/uinput ] ; then + modprobe -q uinput || true + wait_for_file /dev/input/uinput 3 || return 1 + fi +} + +wait_usr_mount() { + if [ ! -e "$DAEMON" ] ; then + wait_for_file "$DAEMON" 7 || return 1 + fi +} + +is_running() { + start-stop-daemon --stop --test --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON +} + +do_start() { + start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON -- $DAEMON_OPTS +} + +do_stop() { + $DAEMON -k + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + --oknodo --retry 5 --exec $DAEMON +} + + +case "$1" in + start) + echo -n "Starting $DESC: " + load_uinput || echo -n ".../dev/input/uinput not found ..." + do_start + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + do_stop + echo "$NAME." + ;; + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # echo "Reloading $DESC configuration files." + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ + # /var/run/$NAME.pid --exec $DAEMON + #;; + force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart" except that it does nothing if the + # daemon isn't already running. + # check wether $DAEMON is running. If so, restart + is_running && $0 restart || exit 0 + ;; + restart) + echo -n "Restarting $DESC: " + do_stop + # the device is slow to shut-down + sleep 1 + do_start + echo "$NAME." + ;; + udev) + log "calling g15 udev; action: $ACTION, product $PRODUCT" + if [ "x$ACTION" = "xadd" ] ; then + load_uinput || true + wait_usr_mount || true + # it seems udev will not release a device if userspace is still + # connected + is_running && ( do_stop; sleep 1 ) + do_start + elif [ "x$ACTION" = "xremove" ] ; then + do_stop + else + echo "unknow udev action '$ACTION'" + exit 1 + + fi + ;; + shared-udev) + # some devices share usb also for audio, which causes some spourios + # udev messages. + log "calling g15 shared-dev; action: $ACTION, product $PRODUCT" + if [ "x$ACTION" = "xadd" ] ; then + load_uinput || true + wait_usr_mount || true + do_start + elif [ "x$ACTION" = "xremove" ] ; then + do_stop + else + echo "unknow udev action '$ACTION'" + exit 1 + + fi + ;; + + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload|udev}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/rc0.d/K01g15daemon b/rc0.d/K01g15daemon new file mode 120000 index 0000000..423fe7b --- /dev/null +++ b/rc0.d/K01g15daemon @@ -0,0 +1 @@ +../init.d/g15daemon \ No newline at end of file diff --git a/rc1.d/K01g15daemon b/rc1.d/K01g15daemon new file mode 120000 index 0000000..423fe7b --- /dev/null +++ b/rc1.d/K01g15daemon @@ -0,0 +1 @@ +../init.d/g15daemon \ No newline at end of file diff --git a/rc2.d/S01g15daemon b/rc2.d/S01g15daemon new file mode 120000 index 0000000..423fe7b --- /dev/null +++ b/rc2.d/S01g15daemon @@ -0,0 +1 @@ +../init.d/g15daemon \ No newline at end of file diff --git a/rc3.d/S01g15daemon b/rc3.d/S01g15daemon new file mode 120000 index 0000000..423fe7b --- /dev/null +++ b/rc3.d/S01g15daemon @@ -0,0 +1 @@ +../init.d/g15daemon \ No newline at end of file diff --git a/rc4.d/S01g15daemon b/rc4.d/S01g15daemon new file mode 120000 index 0000000..423fe7b --- /dev/null +++ b/rc4.d/S01g15daemon @@ -0,0 +1 @@ +../init.d/g15daemon \ No newline at end of file diff --git a/rc5.d/S01g15daemon b/rc5.d/S01g15daemon new file mode 120000 index 0000000..423fe7b --- /dev/null +++ b/rc5.d/S01g15daemon @@ -0,0 +1 @@ +../init.d/g15daemon \ No newline at end of file diff --git a/rc6.d/K01g15daemon b/rc6.d/K01g15daemon new file mode 120000 index 0000000..423fe7b --- /dev/null +++ b/rc6.d/K01g15daemon @@ -0,0 +1 @@ +../init.d/g15daemon \ No newline at end of file