diff options
author | sputnick | 2015-06-18 23:46:03 +0200 |
---|---|---|
committer | sputnick | 2015-06-18 23:46:03 +0200 |
commit | 1252f11f57c31e6fb3ac805044f6a844c9178225 (patch) | |
tree | 6f728daced4c876f04f7d9907e454f2d21d9d4c8 | |
download | aur-1252f11f57c31e6fb3ac805044f6a844c9178225.tar.gz |
Initial sysrqd commit
-rw-r--r-- | .FILELIST | 2 | ||||
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | sysrqd.install | 92 |
4 files changed, 148 insertions, 0 deletions
diff --git a/.FILELIST b/.FILELIST new file mode 100644 index 000000000000..3e06b157c9af --- /dev/null +++ b/.FILELIST @@ -0,0 +1,2 @@ +/usr/sbin/sysrqd +/etc/rc.d/sysrqd diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b1e98daface2 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = sysrqd + pkgdesc = A small daemon intended to manage Linux Sysrq over network. + pkgver = v14.r0.ge9479f8 + pkgrel = 1 + url = http://julien.danjou.info/software/sysrqd + install = sysrqd.install + arch = i686 + arch = x86_64 + license = GPL + provides = sysrqd + conflicts = sysrqd + source = sysrqd::git+https://github.com/jd/sysrqd.git + md5sums = SKIP + sha256sums = SKIP + +pkgname = sysrqd + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..925e2d46ceea --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Contributor: sputnick <gilles DOT quenot AT gmail DOT com> +pkgname=sysrqd +pkgver=v14.r0.ge9479f8 +pkgrel=1 +pkgdesc="A small daemon intended to manage Linux Sysrq over network." +arch=('i686' 'x86_64') +url="http://julien.danjou.info/software/$pkgname" +license="GPL" +install="${pkgname}.install" +conflicts=('sysrqd') +provides=('sysrqd') + +#_gitroot="$_pkgname::git+https://github.com/jd/sysrqd" +#_gitname=$pkgname + +source=( "$pkgname::git+https://github.com/jd/sysrqd.git" ) +md5sums=('SKIP') + + +build() { + cd $pkgname + make +} + +### +sha256sums=('SKIP') + +pkgver() { + cd ${srcdir}/${pkgname} + git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g' +} + +package() { + cd ${srcdir}/${pkgname} + install -Dm755 "$srcdir/$pkgname/$pkgname" "$pkgdir/usr/bin/$pkgname" +} + diff --git a/sysrqd.install b/sysrqd.install new file mode 100644 index 000000000000..974683a706c0 --- /dev/null +++ b/sysrqd.install @@ -0,0 +1,92 @@ +post_install() { +cat<<'EOF' > /etc/rc.d/sysrqd || return 1 +#!/bin/bash + +# +# writen by sputnick for archlinux/AUR <gilles DOT quenot AT gmail DOT com> +# adapted from debian sysrqd init script - Julien Danjou <acid@debian.org> +# + +. /etc/rc.conf +. /etc/rc.d/functions + + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/sysrqd +NAME=sysrqd +DESC="sysrq daemon" +SECRET=/etc/sysrqd.secret +PID=$(pgrep -f /usr/sbin/sysrqd) + +[[ -x $DAEMON && -f $SECRET ]] || exit 0 + +# Include sysrqd defaults if available +[[ -f /etc/conf.d/sysrqd ]] && . /etc/conf.d/sysrqd + +case "$1" in + start) + stat_busy "Starting $DESC: " + [[ ! $PID ]] && $DAEMON -- $DAEMON_OPTS + + if(($? > 0 )); then + stat_fail + else + add_daemon $NAME + stat_done + fi + ;; + stop) + stat_busy "Stopping $DESC: " + [[ $PID ]] && kill $PID &> /dev/null + + if(( $? > 0 )); then + stat_fail + else + rm_daemon $NAME + stat_done + fi + + ;; + restart|force-reload) + stat_busy "Restarting $DESC: " + $0 stop + sleep 1 + $0 start + ;; + *) + N=/etc/rc.d/$NAME + printf "Usage: $N {start|stop|restart|force-reload}\n" >&2 + exit 1 + ;; +esac + +exit 0 +EOF +chmod 0755 /etc/rc.d/sysrqd || return 1 + +cat<<EOF +- Add sysrqd to /etc/rc.conf to run sysrqd at bootup + +- Create a password file: + echo "mypassword" > /etc/sysrqd.secret + chmod 0600 /etc/sysrqd.secret + +- Optionnaly, create a bind file to bind to a specific IP + echo 192.168.2.13 > /etc/sysrqd.bind + +EOF + +} + +post_upgrade() { + /bin/true +} + +pre_remove() { + /bin/rm -f /usr/bin/sysrqd /usr/sbin/sysrqd /etc/rc.d/sysrqd +} + +op=$1 +shift + +$op "$@" |