Browse Source

Inadyn systemd daemon

Bob Mottram 7 years ago
parent
commit
5a24012929
2 changed files with 20 additions and 12 deletions
  1. 10
    6
      src/freedombone-image-customise
  2. 10
    6
      src/freedombone-utils-web

+ 10
- 6
src/freedombone-image-customise View File

@@ -1657,7 +1657,7 @@ image_install_inadyn() {
1657 1657
         mkdir -p "$rootdir/root/build"
1658 1658
     fi
1659 1659
     chroot "$rootdir" apt-get -yq install build-essential curl libgnutls28-dev automake1.11 libconfuse-dev
1660
-    chroot "$rootdir" apt-get -yq install gnutls-dev libconfuse-dev
1660
+    chroot "$rootdir" apt-get -yq install gnutls-dev libconfuse-dev pkg-config
1661 1661
 
1662 1662
     if [ -d /repos/inadyn ]; then
1663 1663
         mkdir "$rootdir/root/build/inadyn"
@@ -1696,13 +1696,17 @@ image_install_inadyn() {
1696 1696
     chmod 600 "$rootdir/etc/inadyn.conf"
1697 1697
 
1698 1698
     { echo '[Unit]';
1699
-      echo 'Description=inadyn (DynDNS updater)';
1700
-      echo 'After=network.target';
1699
+      echo 'Description=Internet Dynamic DNS Client';
1700
+      echo 'Documentation=man:inadyn';
1701
+      echo 'Documentation=man:inadyn.conf';
1702
+      echo 'Documentation=https://github.com/troglobit/inadyn';
1703
+      echo 'ConditionPathExists=/etc/inadyn.conf';
1704
+      echo 'After=network-online.target';
1705
+      echo 'Requires=network-online.target';
1701 1706
       echo '';
1702 1707
       echo '[Service]';
1703
-      echo 'ExecStart=/usr/sbin/inadyn --config /etc/inadyn.conf';
1704
-      echo 'Restart=always';
1705
-      echo 'Type=forking';
1708
+      echo 'Type=simple';
1709
+      echo "ExecStart=/usr/sbin/inadyn -n -s --config ${INADYN_CONFIG_FILE}";
1706 1710
       echo '';
1707 1711
       echo '[Install]';
1708 1712
       echo 'WantedBy=multi-user.target'; } > "$rootdir/etc/systemd/system/inadyn.service"

+ 10
- 6
src/freedombone-utils-web View File

@@ -526,7 +526,7 @@ function install_dynamicdns {
526 526
     # https version 1.99.8
527 527
 
528 528
     apt-get -yq install build-essential curl libgnutls28-dev automake1.11
529
-    apt-get -yq install gnutls-dev libconfuse-dev
529
+    apt-get -yq install gnutls-dev libconfuse-dev pkg-config
530 530
 
531 531
     if [ ! -d "$INSTALL_DIR/inadyn" ]; then
532 532
         if [ -d /repos/inadyn ]; then
@@ -568,13 +568,17 @@ function install_dynamicdns {
568 568
     chmod 600 "${INADYN_CONFIG_FILE}"
569 569
 
570 570
     { echo '[Unit]';
571
-      echo 'Description=inadyn (DynDNS updater)';
572
-      echo 'After=network.target';
571
+      echo 'Description=Internet Dynamic DNS Client';
572
+      echo 'Documentation=man:inadyn';
573
+      echo 'Documentation=man:inadyn.conf';
574
+      echo 'Documentation=https://github.com/troglobit/inadyn';
575
+      echo 'ConditionPathExists=/etc/inadyn.conf';
576
+      echo 'After=network-online.target';
577
+      echo 'Requires=network-online.target';
573 578
       echo '';
574 579
       echo '[Service]';
575
-      echo "ExecStart=/usr/sbin/inadyn --config ${INADYN_CONFIG_FILE}";
576
-      echo 'Restart=always';
577
-      echo 'Type=forking';
580
+      echo 'Type=simple';
581
+      echo "ExecStart=/usr/sbin/inadyn -n -s --config ${INADYN_CONFIG_FILE}";
578 582
       echo '';
579 583
       echo '[Install]';
580 584
       echo 'WantedBy=multi-user.target'; } > /etc/systemd/system/inadyn.service