summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD13
-rwxr-xr-xcachefilesd49
-rw-r--r--cachefilesd.service10
4 files changed, 21 insertions, 57 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e50bce29416..d7637206c3e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -9,9 +9,9 @@ pkgbase = cachefilesd
depends = glibc
backup = etc/cachefilesd.conf
source = http://people.redhat.com/~dhowells/fscache/cachefilesd-0.10.5.tar.bz2
- source = cachefilesd
- md5sums = 9e85dd0ace346ff47e188ded8c05ab3b
- md5sums = a4f0c47a945f296f120e29f156aea9ba
+ source = cachefilesd.service
+ sha256sums = 125ea4f6aef4bf8e936a7cc747b59e074537a8aed74cd1bab3f05d7fbc47287f
+ sha256sums = 0a76a82184d465cf6a663642557219ea9e2fc18bbe24af2bad55ca61db559c5d
pkgname = cachefilesd
diff --git a/PKGBUILD b/PKGBUILD
index d51a094a5bf..13f87373e6e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,5 @@
-# Maintainer: Rémy Oudompheng <remy@archlinux.org>
+# Contributor: Mantas Mikulėnas <grawity@gmail.com>
+# Contributor: Rémy Oudompheng <remy@archlinux.org>
pkgname=cachefilesd
pkgver=0.10.5
@@ -9,10 +10,10 @@ url="http://people.redhat.com/~dhowells/fscache/"
license=('GPL')
depends=('glibc')
source=(http://people.redhat.com/~dhowells/fscache/${pkgname}-${pkgver}.tar.bz2
- cachefilesd)
+ cachefilesd.service)
+sha256sums=('125ea4f6aef4bf8e936a7cc747b59e074537a8aed74cd1bab3f05d7fbc47287f'
+ '0a76a82184d465cf6a663642557219ea9e2fc18bbe24af2bad55ca61db559c5d')
backup=(etc/cachefilesd.conf)
-md5sums=('9e85dd0ace346ff47e188ded8c05ab3b'
- 'a4f0c47a945f296f120e29f156aea9ba')
build() {
cd "$pkgname-$pkgver"
@@ -22,5 +23,7 @@ build() {
package() {
cd "$pkgname-$pkgver"
make DESTDIR="$pkgdir" install
- install -D -m 755 "${srcdir}/cachefilesd" "${pkgdir}/etc/rc.d/cachefilesd"
+ install -D -m 644 "$srcdir/cachefilesd.service" "$pkgdir/usr/lib/systemd/system/cachefilesd.service"
}
+
+# vim: ts=2:sw=2:et:nowrap
diff --git a/cachefilesd b/cachefilesd
deleted file mode 100755
index 4624369c9e5..00000000000
--- a/cachefilesd
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-
-pidfile="/run/cachefilesd.pid"
-
-get_pid() {
- if [ -r "${pid_file}" ]; then
- cat "${pid_file}"
- else
- pgrep -f /sbin/cachefilesd
- fi
-}
-
-PID=$(get_pid)
-
-case "$1" in
- start)
- stat_busy "Starting cachefilesd"
- modprobe cachefiles 2>/dev/null
- [[ -z "$PID" ]] && /sbin/cachefilesd -p "$pidfile"
- if (( $? > 0 )); then
- stat_fail
- else
- add_daemon cachefilesd
- stat_done
- fi
- ;;
- stop)
- stat_busy "Stopping cachefilesd"
- [[ ! -z "$PID" ]] && kill $PID &> /dev/null
- if (( $? > 0 )); then
- stat_fail
- else
- rm -f "$pidfile"
- rm_daemon cachefilesd
- stat_done
- fi
- ;;
- restart)
- $0 stop
- sleep 0.5
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
-esac
-exit 0
diff --git a/cachefilesd.service b/cachefilesd.service
new file mode 100644
index 00000000000..e97dfa6a040
--- /dev/null
+++ b/cachefilesd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=CacheFiles Userspace Management Daemon
+
+[Service]
+Type=forking
+ExecStartPre=-/usr/bin/modprobe cachefiles
+ExecStart=/usr/bin/cachefilesd -f /etc/cachefilesd.conf
+
+[Install]
+WantedBy=multi-user.target