Skip to content

Commit

Permalink
fix(package): make rpm verify pass after installation
Browse files Browse the repository at this point in the history
  • Loading branch information
affo committed Apr 15, 2019
1 parent d24b7ba commit 49c9054
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

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

for f in CONFIGURATION_FILES:
Expand Down Expand Up @@ -168,7 +174,7 @@ def go_get(branch, update=False, no_uncommitted=False):
run(get_command)
logging.info("Retrieving dependencies with `dep`...")
sys.stdout.flush()
run("{}/bin/dep ensure -v -vendor-only".format(os.environ.get("GOPATH")))
run("{}/bin/dep ensure -v -vendor-only".format(os.environ.get("GOPATH", os.path.expanduser("~/go"))))
return True

def run_tests(race, parallel, timeout, no_vet, junit=False):
Expand Down
9 changes: 6 additions & 3 deletions scripts/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ if [[ $? -ne 0 ]]; then
useradd --system -U -M influxdb -s /bin/false -d $DATA_DIR
fi

chown -R -L influxdb:influxdb $DATA_DIR
chown -R -L influxdb:influxdb $LOG_DIR

# Add defaults file, if it doesn't exist
if [[ ! -f /etc/default/influxdb ]]; then
touch /etc/default/influxdb
Expand All @@ -53,6 +50,12 @@ if [[ -f /etc/redhat-release ]]; then
install_chkconfig
fi
elif [[ -f /etc/debian_version ]]; then
# 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.
chown -R -L influxdb:influxdb $DATA_DIR
chown -R -L influxdb:influxdb $LOG_DIR

# Debian/Ubuntu logic
if command -v systemctl &>/dev/null; then
install_systemd
Expand Down

0 comments on commit 49c9054

Please sign in to comment.