mirror of
https://github.com/nikdoof/vsphere-influxdb-go.git
synced 2025-12-19 05:29:21 +00:00
add vendoring with go dep
This commit is contained in:
73
vendor/github.com/influxdata/influxdb/scripts/post-install.sh
generated
vendored
Normal file
73
vendor/github.com/influxdata/influxdb/scripts/post-install.sh
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
|
||||
BIN_DIR=/usr/bin
|
||||
DATA_DIR=/var/lib/influxdb
|
||||
LOG_DIR=/var/log/influxdb
|
||||
SCRIPT_DIR=/usr/lib/influxdb/scripts
|
||||
LOGROTATE_DIR=/etc/logrotate.d
|
||||
|
||||
function install_init {
|
||||
cp -f $SCRIPT_DIR/init.sh /etc/init.d/influxdb
|
||||
chmod +x /etc/init.d/influxdb
|
||||
}
|
||||
|
||||
function install_systemd {
|
||||
cp -f $SCRIPT_DIR/influxdb.service /lib/systemd/system/influxdb.service
|
||||
systemctl enable influxdb
|
||||
}
|
||||
|
||||
function install_update_rcd {
|
||||
update-rc.d influxdb defaults
|
||||
}
|
||||
|
||||
function install_chkconfig {
|
||||
chkconfig --add influxdb
|
||||
}
|
||||
|
||||
id influxdb &>/dev/null
|
||||
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
|
||||
fi
|
||||
|
||||
# Remove legacy symlink, if it exists
|
||||
if [[ -L /etc/init.d/influxdb ]]; then
|
||||
rm -f /etc/init.d/influxdb
|
||||
fi
|
||||
|
||||
# Distribution-specific logic
|
||||
if [[ -f /etc/redhat-release ]]; then
|
||||
# RHEL-variant logic
|
||||
which systemctl &>/dev/null
|
||||
if [[ $? -eq 0 ]]; then
|
||||
install_systemd
|
||||
else
|
||||
# Assuming sysv
|
||||
install_init
|
||||
install_chkconfig
|
||||
fi
|
||||
elif [[ -f /etc/debian_version ]]; then
|
||||
# Debian/Ubuntu logic
|
||||
which systemctl &>/dev/null
|
||||
if [[ $? -eq 0 ]]; then
|
||||
install_systemd
|
||||
else
|
||||
# Assuming sysv
|
||||
install_init
|
||||
install_update_rcd
|
||||
fi
|
||||
elif [[ -f /etc/os-release ]]; then
|
||||
source /etc/os-release
|
||||
if [[ $ID = "amzn" ]]; then
|
||||
# Amazon Linux logic
|
||||
install_init
|
||||
install_chkconfig
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user