summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMantas Mikulėnas2016-03-02 16:18:48 +0200
committerNarrat2016-03-24 00:22:41 +0100
commitc29e5f5d98084a6c7934924a4a1d897b37ac28ab (patch)
tree44aa677b371862590b3a6d95412f7bd7b4580a3b
parentf11829c9d6eba03c91b5550520e1e48337338629 (diff)
downloadaur-c29e5f5d98084a6c7934924a4a1d897b37ac28ab.tar.gz
install a systemd .service
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD6
-rw-r--r--clamfs.rc.d51
-rw-r--r--clamfs.service9
4 files changed, 16 insertions, 56 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fb2c7cbb1e30..b1b1620fd137 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,3 +1,5 @@
+# Generated by mksrcinfo v8
+# Wed Mar 2 14:18:39 UTC 2016
pkgbase = clamfs
pkgdesc = A user-space anti-virus protected file system
pkgver = 1.0.1
@@ -15,10 +17,10 @@ pkgbase = clamfs
backup = etc/clamav/clamfs.xml
source = http://downloads.sourceforge.net/clamfs/clamfs-1.0.1.tar.gz
source = scancache.cxx.patch
- source = clamfs.rc.d
+ source = clamfs.service
md5sums = e1528c48d3b2340b6c3ee83cfb427820
md5sums = a672569c2caab2cc855cc7df1c9536d8
- md5sums = 4fd3f09866fb4bd20098f1da5d011a42
+ md5sums = 04c1ffa3c132ccfddc2d83c43c4f4bd7
pkgname = clamfs
diff --git a/PKGBUILD b/PKGBUILD
index 2a369d434271..e79f61203b89 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,10 +11,10 @@ makedepends=('boost>=1.33')
backup=('etc/clamav/clamfs.xml')
source=("http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz"
"scancache.cxx.patch"
- "clamfs.rc.d")
+ "clamfs.service")
md5sums=('e1528c48d3b2340b6c3ee83cfb427820'
'a672569c2caab2cc855cc7df1c9536d8'
- '4fd3f09866fb4bd20098f1da5d011a42')
+ '04c1ffa3c132ccfddc2d83c43c4f4bd7')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
@@ -37,7 +37,7 @@ package() {
sed -i -e 's#clamd socket="/var/run/clamav/clamd.ctl"#clamd socket="/var/lib/clamav/clamd.sock"#g' \
"${pkgdir}/etc/clamav/clamfs.xml"
# install startup script
- install -D -m755 "${srcdir}/clamfs.rc.d" "${pkgdir}/etc/rc.d/clamfs"
+ install -D -m644 "${srcdir}/clamfs.service" "${pkgdir}/usr/lib/systemd/system/clamfs.service"
}
# vim:set ts=2 sw=2 et:
diff --git a/clamfs.rc.d b/clamfs.rc.d
deleted file mode 100644
index f5853c64ca66..000000000000
--- a/clamfs.rc.d
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-
-PID=`pidof -o %PPID /usr/bin/clamfs`
-
-case "$1" in
- start)
- # if clamd isn't started first, notifyclamd fails at times
- stat_busy "Starting ClamFS"
- [ -z "$PID" ] && /usr/bin/clamfs /etc/clamav/clamfs.xml > /dev/null
-
- if [ $? -gt 0 ]; then
- stat_fail
- else
- add_daemon clamfs
- stat_done
- fi
- ;;
-
- stop)
- stat_busy "Stopping ClamFS"
- [ -n "$PID" ] && kill $PID &> /dev/null
-
- if [ $? -gt 0 ]; then
- stat_fail
- else
- rm_daemon clamfs
- stat_done
- fi
- ;;
-
- restart)
- $0 stop
- sleep 3
- $0 start
- ;;
-
- status)
- stat_busy "Checking ClamFS status";
- ck_status clamfs
- ;;
-
- *)
- echo "usage: $0 {start|stop|restart|status}"
-esac
-
-exit 0
-
-# vim:set ts=2 sw=2 et:
diff --git a/clamfs.service b/clamfs.service
new file mode 100644
index 000000000000..402c61e9eff9
--- /dev/null
+++ b/clamfs.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=ClamFS
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/clamfs /etc/clamav/clamfs.xml
+
+[Install]
+WantedBy=multi-user.target