Skip to content

Commit

Permalink
v6.27
Browse files Browse the repository at this point in the history
+ DietPi-Software | No-IP: Slightly update the systemd unit to pull and sort itself after network-online.target (available since Stretch) and remove RemainAfterExit which is not required for Type=forking where the service is assumed to be active anyway after main process exited (client fork with user "nobody"). Since there is no chance to have the client creating a PID file, we indeed must kill it by name on service stop.
  • Loading branch information
MichaIng authored Oct 26, 2019
1 parent e998ec0 commit bcf43ea
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -1344,12 +1344,13 @@ DietPi-Software will decrypt and use it for software installs. You can change it
aSOFTWARE_TYPE[$software_id]=0
# - Bullseye
aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0

# Remote Access
#--------------------------------------------------------------------------------
software_id=67

aSOFTWARE_NAME[$software_id]='NoIp'
aSOFTWARE_DESC[$software_id]='url website address for your device'
aSOFTWARE_NAME[$software_id]='No-IP'
aSOFTWARE_DESC[$software_id]='Dynamic DNS update client'
aSOFTWARE_CATEGORY_INDEX[$software_id]=10
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=58#p58'
Expand Down Expand Up @@ -8322,15 +8323,15 @@ _EOF_
# noip2 service file
cat << _EOF_ > /etc/systemd/system/noip2.service
[Unit]
Description=noip2 (DietPi)
After=network.target network-online.target rsyslog.service
Description=No-IP update client (DietPi)
Wants=network-online.target
After=network-online.target rsyslog.service
ConditionPathExists=/usr/local/etc/no-ip2.conf

[Service]
Type=forking
RemainAfterExit=yes
ExecStart=/usr/local/bin/noip2
ExecStop=/usr/bin/killall -w noip2
ExecStop=$(command -v killall) -w noip2

[Install]
WantedBy=multi-user.target
Expand Down Expand Up @@ -13134,9 +13135,14 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then

Banner_Uninstalling
if [[ -f '/etc/systemd/system/noip2.service' ]]; then

systemctl disable --now noip2
rm -R /etc/systemd/system/noip2.service*

fi
[[ -f '/usr/local/bin/noip2' ]] && rm /usr/local/bin/noip2
[[ -f '/usr/local/etc/no-ip2.conf' ]] && rm /usr/local/etc/no-ip2.conf
[[ -f '/etc/systemd/system/noip2.service' ]] && rm /etc/systemd/system/noip2.service

fi

Expand Down

0 comments on commit bcf43ea

Please sign in to comment.