fix(package): make rpm verify pass after installation
parent
2d67c8fa2d
commit
21993eaa36
|
@ -18,6 +18,8 @@ import json
|
||||||
|
|
||||||
# Packaging variables
|
# Packaging variables
|
||||||
PACKAGE_NAME = "chronograf"
|
PACKAGE_NAME = "chronograf"
|
||||||
|
USER = "chronograf"
|
||||||
|
GROUP = "chronograf"
|
||||||
INSTALL_ROOT_DIR = "/usr/bin"
|
INSTALL_ROOT_DIR = "/usr/bin"
|
||||||
LOG_DIR = "/var/log/chronograf"
|
LOG_DIR = "/var/log/chronograf"
|
||||||
DATA_DIR = "/var/lib/chronograf"
|
DATA_DIR = "/var/lib/chronograf"
|
||||||
|
@ -61,6 +63,8 @@ fpm_common_args = "-f -s dir --log error \
|
||||||
--maintainer {} \
|
--maintainer {} \
|
||||||
--directories {} \
|
--directories {} \
|
||||||
--directories {} \
|
--directories {} \
|
||||||
|
--rpm-attr 755,{},{}:{} \
|
||||||
|
--rpm-attr 755,{},{}:{} \
|
||||||
--description \"{}\"".format(
|
--description \"{}\"".format(
|
||||||
VENDOR,
|
VENDOR,
|
||||||
PACKAGE_URL,
|
PACKAGE_URL,
|
||||||
|
@ -70,6 +74,8 @@ fpm_common_args = "-f -s dir --log error \
|
||||||
MAINTAINER,
|
MAINTAINER,
|
||||||
LOG_DIR,
|
LOG_DIR,
|
||||||
DATA_DIR,
|
DATA_DIR,
|
||||||
|
USER, GROUP, LOG_DIR,
|
||||||
|
USER, GROUP, DATA_DIR,
|
||||||
DESCRIPTION)
|
DESCRIPTION)
|
||||||
|
|
||||||
for f in CONFIGURATION_FILES:
|
for f in CONFIGURATION_FILES:
|
||||||
|
|
|
@ -33,13 +33,6 @@ if [[ $? -ne 0 ]]; then
|
||||||
useradd --system -U -M chronograf -s /bin/false -d $DATA_DIR
|
useradd --system -U -M chronograf -s /bin/false -d $DATA_DIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test -d $LOG_DIR || mkdir -p $DATA_DIR
|
|
||||||
test -d $DATA_DIR || mkdir -p $DATA_DIR
|
|
||||||
chown -R -L chronograf:chronograf $LOG_DIR
|
|
||||||
chown -R -L chronograf:chronograf $DATA_DIR
|
|
||||||
chmod 755 $LOG_DIR
|
|
||||||
chmod 755 $DATA_DIR
|
|
||||||
|
|
||||||
# Remove legacy symlink, if it exists
|
# Remove legacy symlink, if it exists
|
||||||
if [[ -L /etc/init.d/chronograf ]]; then
|
if [[ -L /etc/init.d/chronograf ]]; then
|
||||||
rm -f /etc/init.d/chronograf
|
rm -f /etc/init.d/chronograf
|
||||||
|
@ -63,6 +56,17 @@ if [[ -f /etc/redhat-release ]]; then
|
||||||
fi
|
fi
|
||||||
elif [[ -f /etc/debian_version ]]; then
|
elif [[ -f /etc/debian_version ]]; then
|
||||||
# Debian/Ubuntu logic
|
# Debian/Ubuntu logic
|
||||||
|
|
||||||
|
# Ownership for RH-based platforms is set in build.py via the `rmp-attr` option.
|
||||||
|
# We perform ownership change only for Debian-based systems.
|
||||||
|
# Moving these lines out of this if statement would make `rmp -V` fail after installation.
|
||||||
|
test -d $LOG_DIR || mkdir -p $DATA_DIR
|
||||||
|
test -d $DATA_DIR || mkdir -p $DATA_DIR
|
||||||
|
chown -R -L chronograf:chronograf $LOG_DIR
|
||||||
|
chown -R -L chronograf:chronograf $DATA_DIR
|
||||||
|
chmod 755 $LOG_DIR
|
||||||
|
chmod 755 $DATA_DIR
|
||||||
|
|
||||||
which systemctl &>/dev/null
|
which systemctl &>/dev/null
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
install_systemd
|
install_systemd
|
||||||
|
|
Loading…
Reference in New Issue