summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames An2015-07-10 22:25:32 -0400
committerJames An2015-07-10 22:25:32 -0400
commit88951dcbb8659c3cce4bf7de97067d26c6e20e4b (patch)
tree662a8cb2f15581bf79eeb8579ad3f2dc3038a128
parentc739752aad82da09315774cf1d066cd5e900f975 (diff)
downloadaur-88951dcbb8659c3cce4bf7de97067d26c6e20e4b.tar.gz
Changed the service unit to better survive failures and added an install file to stop the service unit if active on remove and restart the service unit if active prior to an upgrade.
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD5
-rw-r--r--macfanctld.install26
-rw-r--r--macfanctld.service3
4 files changed, 35 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 85876b21354..eedddccbb09 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = macfanctld
pkgdesc = Fan control daemon for MacBook
pkgver = 0.6
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/MikaelStrom/macfanctld
+ install = macfanctld.install
arch = i686
arch = x86_64
license = GPL3
@@ -12,7 +13,7 @@ pkgbase = macfanctld
source = https://github.com/MikaelStrom/macfanctld/archive/master.tar.gz
source = macfanctld.service
md5sums = d1a42fe34cbb4e830bed5547bef969df
- md5sums = 3ae082c7be885c8427eee8108393fc90
+ md5sums = 3debfbd8f3e9110d1581adb0c97ced71
pkgname = macfanctld
diff --git a/PKGBUILD b/PKGBUILD
index f028a5b30fe..b3f1d2c7300 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=macfanctld
pkgver=0.6
-pkgrel=1
+pkgrel=2
arch=(i686 x86_64)
pkgdesc="Fan control daemon for MacBook"
url="https://github.com/MikaelStrom/macfanctld"
@@ -11,12 +11,13 @@ license="GPL3"
makedepends=('gcc')
depends=('glibc')
backup=('etc/macfanctl.conf')
+install=$pkgname.install
source=(
"https://github.com/MikaelStrom/$pkgname/archive/master.tar.gz"
"$pkgname.service"
)
md5sums=('d1a42fe34cbb4e830bed5547bef969df'
- '3ae082c7be885c8427eee8108393fc90')
+ '3debfbd8f3e9110d1581adb0c97ced71')
prepare() {
cd "$pkgname-master"
diff --git a/macfanctld.install b/macfanctld.install
new file mode 100644
index 00000000000..473e4ab0a5d
--- /dev/null
+++ b/macfanctld.install
@@ -0,0 +1,26 @@
+pre_upgrade() {
+ local _active=/tmp/.macfanctld
+ systemctl daemon-reload
+ if [ $(systemctl is-active macfanctld.service) ]; then
+ systemctl --quiet stop macfanctld.service
+ touch $_active
+ elif [ -f $_active ]; then
+ rm --force $_active
+ fi
+}
+
+post_upgrade() {
+ local _active=/tmp/.macfanctld
+ systemctl daemon-reload
+ if [ -f $_active ]; then
+ systemctl --quiet start macfanctld.service
+ rm --force $_active
+ fi
+}
+
+pre_remove() {
+ if [ $(systemctl is-active macfanctld.service) ]; then
+ systemctl --quiet stop macfanctld.service
+ fi
+}
+
diff --git a/macfanctld.service b/macfanctld.service
index c3743414ee4..616cbb28923 100644
--- a/macfanctld.service
+++ b/macfanctld.service
@@ -3,7 +3,10 @@ Description=Mac Fan Control Daemon
Documentation=man:macfanctld(1)
[Service]
+Type=idle
ExecStart=/usr/bin/macfanctld -f
+Restart=on-failure
+RestartSec=1
[Install]
WantedBy=multi-user.target