forked from yp-engineering/rbd-docker-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostremove
More file actions
executable file
·29 lines (25 loc) · 740 Bytes
/
postremove
File metadata and controls
executable file
·29 lines (25 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -e
set -u
# rbd-docker-plugin postremove
SYSTEMD_SVC=rbd-docker-plugin.service
UPSTART_INIT=/etc/init/rbd-docker-plugin.conf
LOGROTATE_CONF=/etc/logrotate.d/rbd-docker-plugin_logrotate
# centos 7.x / systemd
if UNIT_DIR=$(pkg-config systemd --variable=systemdsystemunitdir); then
# stop and disable system service unit
systemctl stop ${SYSTEMD_SVC}
systemctl disable ${SYSTEMD_SVC}
# unlink the tpkg .service file
rm -vf "${UNIT_DIR}/${SYSTEMD_SVC}"
else
# centos 6 / remove the upstart softlink
if test -L "$UPSTART_INIT" ; then
stop rbd-docker-plugin
rm -f "$UPSTART_INIT"
fi
fi
# remove log config
if test -f "$LOGROTATE_CONF" ; then
rm -vf "$LOGROTATE_CONF"
fi