Add SLES11 support to rpm package (#2768)
This commit is contained in:
parent
a8cfe03ba8
commit
67cd1669cc
|
@ -636,6 +636,10 @@ def package(build_output, pkg_name, version, nightly=False, iteration=1, static=
|
||||||
elif package_type not in ['zip', 'tar'] and static or "static_" in arch:
|
elif package_type not in ['zip', 'tar'] and static or "static_" in arch:
|
||||||
logging.info("Skipping package type '{}' for static builds.".format(package_type))
|
logging.info("Skipping package type '{}' for static builds.".format(package_type))
|
||||||
else:
|
else:
|
||||||
|
if package_type == 'rpm' and release and '~' in package_version:
|
||||||
|
package_version, suffix = package_version.split('~', 1)
|
||||||
|
# The ~ indicatees that this is a prerelease so we give it a leading 0.
|
||||||
|
package_iteration = "0.%s" % suffix
|
||||||
fpm_command = "fpm {} --name {} -a {} -t {} --version {} --iteration {} -C {} -p {} ".format(
|
fpm_command = "fpm {} --name {} -a {} -t {} --version {} --iteration {} -C {} -p {} ".format(
|
||||||
fpm_common_args,
|
fpm_common_args,
|
||||||
name,
|
name,
|
||||||
|
@ -664,9 +668,6 @@ def package(build_output, pkg_name, version, nightly=False, iteration=1, static=
|
||||||
if package_type == 'rpm':
|
if package_type == 'rpm':
|
||||||
# rpm's convert any dashes to underscores
|
# rpm's convert any dashes to underscores
|
||||||
package_version = package_version.replace("-", "_")
|
package_version = package_version.replace("-", "_")
|
||||||
new_outfile = outfile.replace("{}-{}".format(package_version, package_iteration), package_version)
|
|
||||||
os.rename(outfile, new_outfile)
|
|
||||||
outfile = new_outfile
|
|
||||||
outfiles.append(os.path.join(os.getcwd(), outfile))
|
outfiles.append(os.path.join(os.getcwd(), outfile))
|
||||||
logging.debug("Produced package files: {}".format(outfiles))
|
logging.debug("Produced package files: {}".format(outfiles))
|
||||||
return outfiles
|
return outfiles
|
||||||
|
|
|
@ -135,7 +135,9 @@ case $1 in
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_success_msg "Starting the process" "$name"
|
log_success_msg "Starting the process" "$name"
|
||||||
if which start-stop-daemon > /dev/null 2>&1; then
|
if command -v startproc >/dev/null; then
|
||||||
|
startproc -u "$USER" -g "$GROUP" -p "$pidfile" -q -- "$daemon" -pidfile "$pidfile" -config "$config" -config-directory "$confdir" $TELEGRAF_OPTS
|
||||||
|
elif which start-stop-daemon > /dev/null 2>&1; then
|
||||||
start-stop-daemon --chuid $USER:$GROUP --start --quiet --pidfile $pidfile --exec $daemon -- -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &
|
start-stop-daemon --chuid $USER:$GROUP --start --quiet --pidfile $pidfile --exec $daemon -- -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &
|
||||||
else
|
else
|
||||||
su -s /bin/sh -c "nohup $daemon -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &" $USER
|
su -s /bin/sh -c "nohup $daemon -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &" $USER
|
||||||
|
|
|
@ -24,12 +24,12 @@ function install_chkconfig {
|
||||||
chkconfig --add telegraf
|
chkconfig --add telegraf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ! grep "^telegraf:" /etc/group &>/dev/null; then
|
||||||
|
groupadd -r telegraf
|
||||||
|
fi
|
||||||
|
|
||||||
if ! id telegraf &>/dev/null; then
|
if ! id telegraf &>/dev/null; then
|
||||||
if ! grep "^telegraf:" /etc/group &>/dev/null; then
|
useradd -r -M telegraf -s /bin/false -d /etc/telegraf -g telegraf
|
||||||
useradd -r -K USERGROUPS_ENAB=yes -M telegraf -s /bin/false -d /etc/telegraf
|
|
||||||
else
|
|
||||||
useradd -r -K USERGROUPS_ENAB=yes -M telegraf -s /bin/false -d /etc/telegraf -g telegraf
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test -d $LOG_DIR || mkdir -p $LOG_DIR
|
test -d $LOG_DIR || mkdir -p $LOG_DIR
|
||||||
|
@ -97,5 +97,6 @@ elif [[ -f /etc/os-release ]]; then
|
||||||
else
|
else
|
||||||
install_chkconfig
|
install_chkconfig
|
||||||
fi
|
fi
|
||||||
|
/etc/init.d/telegraf restart
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue