diff --git a/package.sh b/package.sh index f9fe1f0900..9226b7d30d 100755 --- a/package.sh +++ b/package.sh @@ -166,15 +166,14 @@ ln -s $INSTALL_ROOT_DIR/versions/$version/influxd $INSTALL_ROOT_DIR/influxd ln -s $INSTALL_ROOT_DIR/versions/$version/influx $INSTALL_ROOT_DIR/influx ln -s $INSTALL_ROOT_DIR/versions/$version/scripts/init.sh $INSTALL_ROOT_DIR/init.sh -if [ ! -L /etc/init.d/influxdb ]; then - ln -sfn $INSTALL_ROOT_DIR/init.sh /etc/init.d/influxdb - chmod +x /etc/init.d/influxdb - if which update-rc.d > /dev/null 2>&1 ; then - update-rc.d -f influxdb remove - update-rc.d influxdb defaults - else - chkconfig --add influxdb - fi +rm -f /etc/init.d/influxdb +ln -sfn $INSTALL_ROOT_DIR/init.sh /etc/init.d/influxdb +chmod +x /etc/init.d/influxdb +if which update-rc.d > /dev/null 2>&1 ; then + update-rc.d -f influxdb remove + update-rc.d influxdb defaults +else + chkconfig --add influxdb fi if ! id influxdb >/dev/null 2>&1; then