mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 02:22:13 +08:00
48 lines
1.2 KiB
Plaintext
48 lines
1.2 KiB
Plaintext
post_install() {
|
|
|
|
# bug: dbus reload here doesn't work
|
|
# workaround: it seems to work if you do it a few seconds later, manually
|
|
reload_dbus
|
|
|
|
/usr/bin/getent group murmur > /dev/null || \
|
|
/usr/sbin/groupadd -r -g 86 murmur 1>/dev/null
|
|
/usr/bin/getent passwd murmur > /dev/null || \
|
|
/usr/sbin/useradd -r -u 86 -d /var/lib/murmur -g murmur -s /bin/false murmur 1>/dev/null
|
|
|
|
chown -R murmur:murmur /var/lib/murmur
|
|
chown -R murmur:murmur /var/log/murmur
|
|
|
|
echo
|
|
echo '==> Set the SuperUser password with (as root):'
|
|
echo '==> murmurd -ini /etc/murmur.ini -supw PASSWORD'
|
|
}
|
|
|
|
post_upgrade() {
|
|
post_install
|
|
}
|
|
|
|
pre_remove() {
|
|
systemd-notify
|
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
[ -f /var/run/daemons/murmur ] && systemctl stop murmur.service
|
|
else
|
|
[ -f /var/run/daemons/murmur ] && /etc/rc.d/murmur stop > /dev/null
|
|
fi
|
|
killall -u murmur -5
|
|
sleep 1
|
|
}
|
|
|
|
post_remove() {
|
|
reload_dbus
|
|
getent passwd murmur > /dev/null && userdel murmur 1>/dev/null
|
|
getent group murmur > /dev/null && groupdel murmur 1>/dev/null
|
|
}
|
|
|
|
reload_dbus() {
|
|
/usr/bin/dbus-send \
|
|
--system --type=method_call \
|
|
--dest=org.freedesktop.DBus \
|
|
/org.freedesktop.DBus.ReloadConfig
|
|
}
|