Skip to content

Commit

Permalink
Merge pull request #5146 from influxdata/fix/rpm-verify
Browse files Browse the repository at this point in the history
fix(package): make rpm verify pass after installation
  • Loading branch information
affo authored Apr 19, 2019
2 parents db87bd4 + 16652aa commit 2930d4a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
6 changes: 6 additions & 0 deletions etc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

# Packaging variables
PACKAGE_NAME = "chronograf"
USER = "chronograf"
GROUP = "chronograf"
INSTALL_ROOT_DIR = "/usr/bin"
LOG_DIR = "/var/log/chronograf"
DATA_DIR = "/var/lib/chronograf"
Expand Down Expand Up @@ -61,6 +63,8 @@
--maintainer {} \
--directories {} \
--directories {} \
--rpm-attr 755,{},{}:{} \
--rpm-attr 755,{},{}:{} \
--description \"{}\"".format(
VENDOR,
PACKAGE_URL,
Expand All @@ -70,6 +74,8 @@
MAINTAINER,
LOG_DIR,
DATA_DIR,
USER, GROUP, LOG_DIR,
USER, GROUP, DATA_DIR,
DESCRIPTION)

for f in CONFIGURATION_FILES:
Expand Down
18 changes: 11 additions & 7 deletions etc/scripts/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ if [[ $? -ne 0 ]]; then
useradd --system -U -M chronograf -s /bin/false -d $DATA_DIR
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
if [[ -L /etc/init.d/chronograf ]]; then
rm -f /etc/init.d/chronograf
Expand All @@ -63,6 +56,17 @@ if [[ -f /etc/redhat-release ]]; then
fi
elif [[ -f /etc/debian_version ]]; then
# 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
if [[ $? -eq 0 ]]; then
install_systemd
Expand Down

0 comments on commit 2930d4a

Please sign in to comment.