Issues creating and enabling custom systemd services for ddclient

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am using ddclient/DDNS under Ubuntu 16.04 LTS to update the IPs which two domains I own (from NameCheap) have a DNS record for (this is working).



However, the issue is that with having two domains, I need two separate instances of ddclient running. I've begun writing two .service files in order to do this:



/usr/lib/systemd/system/ddclient_website1.service



[Unit]
Description=DDNS client for website1.tld

[Service]
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf

[Install]
WantedBy=multi-user.target


/usr/lib/systemd/system/ddclient_website2.service



[Unit]
Description=DDNS client for website2.tld

[Service]
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website2.conf

[Install]
WantedBy=multi-user.target


With the configurations, specified in the ExecStart commands, as specified below:



/etc/ddclient_website1.conf



daemon=1800
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=domain_1.tld
password=first_ddns_password
server_name


/etc/ddclient_website2.conf



daemon=1800
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=domain_2.tld
password=second_ddns_password
server_name


And using systemctl enable ddclient_website1.service (same for website2) yields:



Created symlink from /etc/systemd/system/multi-user.target.wants/ddclient_website1.service to /usr/lib/systemd/system/ddclient_website1.service.



systemctl start ddclient_website1.service yields no output.



ps -ef | grep ddclient lists only the grep just ran, and systemctl status ddclient_website1.service yields:



● ddclient_website1.service - DDNS client for website1.tld
Loaded: loaded (/usr/lib/systemd/system/ddclient_website1.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2016-12-18 15:34:23 EST; 39s ago
Process: 2687 ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf (code=exited, status=0/SUCCESS)
Main PID: 2687 (code=exited, status=0/SUCCESS)

Dec 18 15:34:23 server_name systemd[1]: Started DDNS client for website1.tld.


A reboot causes no positive changes.



Edit:



After modification of the .servicefiles to the default .service file created during install of ddclient, I am now able to start the services (they are listed in ps -ef | grep ddclient.



[Unit]
Description=DDNS client for website1.tld
After=network.target

[Service]
Type=forking
PIDFile=/var/run/ddclient_website1.pid
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf

[Install]
WantedBy=default.target


However, after running for 40-50 seconds, they timeout, stating the PID files they need to access do not exist (same issue for both services):



● ddclient_website1.service - DDNS client for website1.tld
Loaded: loaded (/usr/lib/systemd/system/ddclient_website1.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Sun 2016-12-18 16:04:14 EST; 22s ago
Process: 1347 ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf (code=exited, status=0/SUCCESS)

Dec 18 16:02:44 server_name systemd[1]: Starting DDNS client for website1.tld...
Dec 18 16:02:44 server_name systemd[1]: ddclient_website1.service: PID file /var/run/ddclient_website1.pid not readable (yet?) after start: No such file or directory
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Start operation timed out. Terminating.
Dec 18 16:04:14 server_name systemd[1]: Failed to start DDNS client for website1.tld.
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Unit entered failed state.
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Failed with result 'timeout'.


I touched ddclient_website1.pid (also for website2) into /var/run and achieved the same result.










share|improve this question























  • I use a single instance of ddclinet to update both my domains. if you can put them both under the same username just add a second host line.
    – Jasen
    Dec 19 '16 at 2:19















up vote
1
down vote

favorite












I am using ddclient/DDNS under Ubuntu 16.04 LTS to update the IPs which two domains I own (from NameCheap) have a DNS record for (this is working).



However, the issue is that with having two domains, I need two separate instances of ddclient running. I've begun writing two .service files in order to do this:



/usr/lib/systemd/system/ddclient_website1.service



[Unit]
Description=DDNS client for website1.tld

[Service]
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf

[Install]
WantedBy=multi-user.target


/usr/lib/systemd/system/ddclient_website2.service



[Unit]
Description=DDNS client for website2.tld

[Service]
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website2.conf

[Install]
WantedBy=multi-user.target


With the configurations, specified in the ExecStart commands, as specified below:



/etc/ddclient_website1.conf



daemon=1800
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=domain_1.tld
password=first_ddns_password
server_name


/etc/ddclient_website2.conf



daemon=1800
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=domain_2.tld
password=second_ddns_password
server_name


And using systemctl enable ddclient_website1.service (same for website2) yields:



Created symlink from /etc/systemd/system/multi-user.target.wants/ddclient_website1.service to /usr/lib/systemd/system/ddclient_website1.service.



systemctl start ddclient_website1.service yields no output.



ps -ef | grep ddclient lists only the grep just ran, and systemctl status ddclient_website1.service yields:



● ddclient_website1.service - DDNS client for website1.tld
Loaded: loaded (/usr/lib/systemd/system/ddclient_website1.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2016-12-18 15:34:23 EST; 39s ago
Process: 2687 ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf (code=exited, status=0/SUCCESS)
Main PID: 2687 (code=exited, status=0/SUCCESS)

Dec 18 15:34:23 server_name systemd[1]: Started DDNS client for website1.tld.


A reboot causes no positive changes.



Edit:



After modification of the .servicefiles to the default .service file created during install of ddclient, I am now able to start the services (they are listed in ps -ef | grep ddclient.



[Unit]
Description=DDNS client for website1.tld
After=network.target

[Service]
Type=forking
PIDFile=/var/run/ddclient_website1.pid
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf

[Install]
WantedBy=default.target


However, after running for 40-50 seconds, they timeout, stating the PID files they need to access do not exist (same issue for both services):



● ddclient_website1.service - DDNS client for website1.tld
Loaded: loaded (/usr/lib/systemd/system/ddclient_website1.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Sun 2016-12-18 16:04:14 EST; 22s ago
Process: 1347 ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf (code=exited, status=0/SUCCESS)

Dec 18 16:02:44 server_name systemd[1]: Starting DDNS client for website1.tld...
Dec 18 16:02:44 server_name systemd[1]: ddclient_website1.service: PID file /var/run/ddclient_website1.pid not readable (yet?) after start: No such file or directory
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Start operation timed out. Terminating.
Dec 18 16:04:14 server_name systemd[1]: Failed to start DDNS client for website1.tld.
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Unit entered failed state.
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Failed with result 'timeout'.


I touched ddclient_website1.pid (also for website2) into /var/run and achieved the same result.










share|improve this question























  • I use a single instance of ddclinet to update both my domains. if you can put them both under the same username just add a second host line.
    – Jasen
    Dec 19 '16 at 2:19













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am using ddclient/DDNS under Ubuntu 16.04 LTS to update the IPs which two domains I own (from NameCheap) have a DNS record for (this is working).



However, the issue is that with having two domains, I need two separate instances of ddclient running. I've begun writing two .service files in order to do this:



/usr/lib/systemd/system/ddclient_website1.service



[Unit]
Description=DDNS client for website1.tld

[Service]
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf

[Install]
WantedBy=multi-user.target


/usr/lib/systemd/system/ddclient_website2.service



[Unit]
Description=DDNS client for website2.tld

[Service]
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website2.conf

[Install]
WantedBy=multi-user.target


With the configurations, specified in the ExecStart commands, as specified below:



/etc/ddclient_website1.conf



daemon=1800
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=domain_1.tld
password=first_ddns_password
server_name


/etc/ddclient_website2.conf



daemon=1800
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=domain_2.tld
password=second_ddns_password
server_name


And using systemctl enable ddclient_website1.service (same for website2) yields:



Created symlink from /etc/systemd/system/multi-user.target.wants/ddclient_website1.service to /usr/lib/systemd/system/ddclient_website1.service.



systemctl start ddclient_website1.service yields no output.



ps -ef | grep ddclient lists only the grep just ran, and systemctl status ddclient_website1.service yields:



● ddclient_website1.service - DDNS client for website1.tld
Loaded: loaded (/usr/lib/systemd/system/ddclient_website1.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2016-12-18 15:34:23 EST; 39s ago
Process: 2687 ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf (code=exited, status=0/SUCCESS)
Main PID: 2687 (code=exited, status=0/SUCCESS)

Dec 18 15:34:23 server_name systemd[1]: Started DDNS client for website1.tld.


A reboot causes no positive changes.



Edit:



After modification of the .servicefiles to the default .service file created during install of ddclient, I am now able to start the services (they are listed in ps -ef | grep ddclient.



[Unit]
Description=DDNS client for website1.tld
After=network.target

[Service]
Type=forking
PIDFile=/var/run/ddclient_website1.pid
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf

[Install]
WantedBy=default.target


However, after running for 40-50 seconds, they timeout, stating the PID files they need to access do not exist (same issue for both services):



● ddclient_website1.service - DDNS client for website1.tld
Loaded: loaded (/usr/lib/systemd/system/ddclient_website1.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Sun 2016-12-18 16:04:14 EST; 22s ago
Process: 1347 ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf (code=exited, status=0/SUCCESS)

Dec 18 16:02:44 server_name systemd[1]: Starting DDNS client for website1.tld...
Dec 18 16:02:44 server_name systemd[1]: ddclient_website1.service: PID file /var/run/ddclient_website1.pid not readable (yet?) after start: No such file or directory
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Start operation timed out. Terminating.
Dec 18 16:04:14 server_name systemd[1]: Failed to start DDNS client for website1.tld.
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Unit entered failed state.
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Failed with result 'timeout'.


I touched ddclient_website1.pid (also for website2) into /var/run and achieved the same result.










share|improve this question















I am using ddclient/DDNS under Ubuntu 16.04 LTS to update the IPs which two domains I own (from NameCheap) have a DNS record for (this is working).



However, the issue is that with having two domains, I need two separate instances of ddclient running. I've begun writing two .service files in order to do this:



/usr/lib/systemd/system/ddclient_website1.service



[Unit]
Description=DDNS client for website1.tld

[Service]
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf

[Install]
WantedBy=multi-user.target


/usr/lib/systemd/system/ddclient_website2.service



[Unit]
Description=DDNS client for website2.tld

[Service]
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website2.conf

[Install]
WantedBy=multi-user.target


With the configurations, specified in the ExecStart commands, as specified below:



/etc/ddclient_website1.conf



daemon=1800
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=domain_1.tld
password=first_ddns_password
server_name


/etc/ddclient_website2.conf



daemon=1800
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=domain_2.tld
password=second_ddns_password
server_name


And using systemctl enable ddclient_website1.service (same for website2) yields:



Created symlink from /etc/systemd/system/multi-user.target.wants/ddclient_website1.service to /usr/lib/systemd/system/ddclient_website1.service.



systemctl start ddclient_website1.service yields no output.



ps -ef | grep ddclient lists only the grep just ran, and systemctl status ddclient_website1.service yields:



● ddclient_website1.service - DDNS client for website1.tld
Loaded: loaded (/usr/lib/systemd/system/ddclient_website1.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2016-12-18 15:34:23 EST; 39s ago
Process: 2687 ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf (code=exited, status=0/SUCCESS)
Main PID: 2687 (code=exited, status=0/SUCCESS)

Dec 18 15:34:23 server_name systemd[1]: Started DDNS client for website1.tld.


A reboot causes no positive changes.



Edit:



After modification of the .servicefiles to the default .service file created during install of ddclient, I am now able to start the services (they are listed in ps -ef | grep ddclient.



[Unit]
Description=DDNS client for website1.tld
After=network.target

[Service]
Type=forking
PIDFile=/var/run/ddclient_website1.pid
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf

[Install]
WantedBy=default.target


However, after running for 40-50 seconds, they timeout, stating the PID files they need to access do not exist (same issue for both services):



● ddclient_website1.service - DDNS client for website1.tld
Loaded: loaded (/usr/lib/systemd/system/ddclient_website1.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Sun 2016-12-18 16:04:14 EST; 22s ago
Process: 1347 ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf (code=exited, status=0/SUCCESS)

Dec 18 16:02:44 server_name systemd[1]: Starting DDNS client for website1.tld...
Dec 18 16:02:44 server_name systemd[1]: ddclient_website1.service: PID file /var/run/ddclient_website1.pid not readable (yet?) after start: No such file or directory
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Start operation timed out. Terminating.
Dec 18 16:04:14 server_name systemd[1]: Failed to start DDNS client for website1.tld.
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Unit entered failed state.
Dec 18 16:04:14 server_name systemd[1]: ddclient_website1.service: Failed with result 'timeout'.


I touched ddclient_website1.pid (also for website2) into /var/run and achieved the same result.







ubuntu systemd services






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 18 '16 at 21:10

























asked Dec 18 '16 at 20:37









Sean Pianka

1065




1065











  • I use a single instance of ddclinet to update both my domains. if you can put them both under the same username just add a second host line.
    – Jasen
    Dec 19 '16 at 2:19

















  • I use a single instance of ddclinet to update both my domains. if you can put them both under the same username just add a second host line.
    – Jasen
    Dec 19 '16 at 2:19
















I use a single instance of ddclinet to update both my domains. if you can put them both under the same username just add a second host line.
– Jasen
Dec 19 '16 at 2:19





I use a single instance of ddclinet to update both my domains. if you can put them both under the same username just add a second host line.
– Jasen
Dec 19 '16 at 2:19











3 Answers
3






active

oldest

votes

















up vote
0
down vote













This may related, try changing the [Install] section to



[Install]
WantedBy=default.target





share|improve this answer






















  • The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled as forking), but that the service timing out due to being unable to access a PID file underneath /var/run.
    – Sean Pianka
    Dec 18 '16 at 21:11










  • when running the same command from a root terminal is the PID file created ? can you add a debug or verbose flag to the ddclient ? (ddclient -daemon=0 -noquiet -debug)
    – Rabin
    Dec 18 '16 at 21:17


















up vote
0
down vote



accepted










The issue was that I hadn't specified where the cache and the PID file were going to be located to ddclient.



As per the --help page:



 -file path : load configuration information from 'path' (default: /etc/ddclient.conf).
-cache path : record address used in 'path' (default: /var/cache/ddclient/ddclient.cache).
-pid path : record process id in 'path'.


My ExecStart command only specified -file, while I needed to also specify -cache and -pid.



Here's my working ddclient_website1.service:



[Unit]
Description=DDNS client for website1.tld
After=network.target

[Service]
Type=forking
PIDFile=/var/run/ddclient_website1.pid
ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf -pid /var/run/ddclient_website1.pid -cache /var/cache/ddclient/ddclient_website1.cache

[Install]
WantedBy=default.target


You are also able to specify these paths in your configuration file for ddclient, in /etc/ddclient_website1.conf:



daemon=1800
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=website1.tld
password=my_ddns_password
cache=/var/cache/ddclient/ddclient_website1.cache
pid=/var/run/ddclient_website1.pid
@


You should now be able to run systemctl enable ddclient_website1.service and systemctl start ddclient_website1.service and have ddclient begin working.






share|improve this answer



























    up vote
    0
    down vote














    [Service]
    ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf



    Using the PIDFile and the Type=forking settings in the INI file is wrong, as is the -pid option to the program. This program (as with so many) does not actually implement the relevant readiness protocol.



    The correct way to proceed, also as with so many other softwares, is to employ the program's -foreground option, which it has had since revision 113 according to its doco.



    Further reading



    • https://unix.stackexchange.com/a/476608/5132

    • https://unix.stackexchange.com/a/200365/5132





    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f331285%2fissues-creating-and-enabling-custom-systemd-services-for-ddclient%23new-answer', 'question_page');

      );

      Post as a guest






























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      This may related, try changing the [Install] section to



      [Install]
      WantedBy=default.target





      share|improve this answer






















      • The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled as forking), but that the service timing out due to being unable to access a PID file underneath /var/run.
        – Sean Pianka
        Dec 18 '16 at 21:11










      • when running the same command from a root terminal is the PID file created ? can you add a debug or verbose flag to the ddclient ? (ddclient -daemon=0 -noquiet -debug)
        – Rabin
        Dec 18 '16 at 21:17















      up vote
      0
      down vote













      This may related, try changing the [Install] section to



      [Install]
      WantedBy=default.target





      share|improve this answer






















      • The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled as forking), but that the service timing out due to being unable to access a PID file underneath /var/run.
        – Sean Pianka
        Dec 18 '16 at 21:11










      • when running the same command from a root terminal is the PID file created ? can you add a debug or verbose flag to the ddclient ? (ddclient -daemon=0 -noquiet -debug)
        – Rabin
        Dec 18 '16 at 21:17













      up vote
      0
      down vote










      up vote
      0
      down vote









      This may related, try changing the [Install] section to



      [Install]
      WantedBy=default.target





      share|improve this answer














      This may related, try changing the [Install] section to



      [Install]
      WantedBy=default.target






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 13 '17 at 12:36









      Community♦

      1




      1










      answered Dec 18 '16 at 21:00









      Rabin

      2,4931918




      2,4931918











      • The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled as forking), but that the service timing out due to being unable to access a PID file underneath /var/run.
        – Sean Pianka
        Dec 18 '16 at 21:11










      • when running the same command from a root terminal is the PID file created ? can you add a debug or verbose flag to the ddclient ? (ddclient -daemon=0 -noquiet -debug)
        – Rabin
        Dec 18 '16 at 21:17

















      • The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled as forking), but that the service timing out due to being unable to access a PID file underneath /var/run.
        – Sean Pianka
        Dec 18 '16 at 21:11










      • when running the same command from a root terminal is the PID file created ? can you add a debug or verbose flag to the ddclient ? (ddclient -daemon=0 -noquiet -debug)
        – Rabin
        Dec 18 '16 at 21:17
















      The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled as forking), but that the service timing out due to being unable to access a PID file underneath /var/run.
      – Sean Pianka
      Dec 18 '16 at 21:11




      The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled as forking), but that the service timing out due to being unable to access a PID file underneath /var/run.
      – Sean Pianka
      Dec 18 '16 at 21:11












      when running the same command from a root terminal is the PID file created ? can you add a debug or verbose flag to the ddclient ? (ddclient -daemon=0 -noquiet -debug)
      – Rabin
      Dec 18 '16 at 21:17





      when running the same command from a root terminal is the PID file created ? can you add a debug or verbose flag to the ddclient ? (ddclient -daemon=0 -noquiet -debug)
      – Rabin
      Dec 18 '16 at 21:17













      up vote
      0
      down vote



      accepted










      The issue was that I hadn't specified where the cache and the PID file were going to be located to ddclient.



      As per the --help page:



       -file path : load configuration information from 'path' (default: /etc/ddclient.conf).
      -cache path : record address used in 'path' (default: /var/cache/ddclient/ddclient.cache).
      -pid path : record process id in 'path'.


      My ExecStart command only specified -file, while I needed to also specify -cache and -pid.



      Here's my working ddclient_website1.service:



      [Unit]
      Description=DDNS client for website1.tld
      After=network.target

      [Service]
      Type=forking
      PIDFile=/var/run/ddclient_website1.pid
      ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf -pid /var/run/ddclient_website1.pid -cache /var/cache/ddclient/ddclient_website1.cache

      [Install]
      WantedBy=default.target


      You are also able to specify these paths in your configuration file for ddclient, in /etc/ddclient_website1.conf:



      daemon=1800
      use=web, web=dynamicdns.park-your-domain.com/getip
      protocol=namecheap
      server=dynamicdns.park-your-domain.com
      login=website1.tld
      password=my_ddns_password
      cache=/var/cache/ddclient/ddclient_website1.cache
      pid=/var/run/ddclient_website1.pid
      @


      You should now be able to run systemctl enable ddclient_website1.service and systemctl start ddclient_website1.service and have ddclient begin working.






      share|improve this answer
























        up vote
        0
        down vote



        accepted










        The issue was that I hadn't specified where the cache and the PID file were going to be located to ddclient.



        As per the --help page:



         -file path : load configuration information from 'path' (default: /etc/ddclient.conf).
        -cache path : record address used in 'path' (default: /var/cache/ddclient/ddclient.cache).
        -pid path : record process id in 'path'.


        My ExecStart command only specified -file, while I needed to also specify -cache and -pid.



        Here's my working ddclient_website1.service:



        [Unit]
        Description=DDNS client for website1.tld
        After=network.target

        [Service]
        Type=forking
        PIDFile=/var/run/ddclient_website1.pid
        ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf -pid /var/run/ddclient_website1.pid -cache /var/cache/ddclient/ddclient_website1.cache

        [Install]
        WantedBy=default.target


        You are also able to specify these paths in your configuration file for ddclient, in /etc/ddclient_website1.conf:



        daemon=1800
        use=web, web=dynamicdns.park-your-domain.com/getip
        protocol=namecheap
        server=dynamicdns.park-your-domain.com
        login=website1.tld
        password=my_ddns_password
        cache=/var/cache/ddclient/ddclient_website1.cache
        pid=/var/run/ddclient_website1.pid
        @


        You should now be able to run systemctl enable ddclient_website1.service and systemctl start ddclient_website1.service and have ddclient begin working.






        share|improve this answer






















          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          The issue was that I hadn't specified where the cache and the PID file were going to be located to ddclient.



          As per the --help page:



           -file path : load configuration information from 'path' (default: /etc/ddclient.conf).
          -cache path : record address used in 'path' (default: /var/cache/ddclient/ddclient.cache).
          -pid path : record process id in 'path'.


          My ExecStart command only specified -file, while I needed to also specify -cache and -pid.



          Here's my working ddclient_website1.service:



          [Unit]
          Description=DDNS client for website1.tld
          After=network.target

          [Service]
          Type=forking
          PIDFile=/var/run/ddclient_website1.pid
          ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf -pid /var/run/ddclient_website1.pid -cache /var/cache/ddclient/ddclient_website1.cache

          [Install]
          WantedBy=default.target


          You are also able to specify these paths in your configuration file for ddclient, in /etc/ddclient_website1.conf:



          daemon=1800
          use=web, web=dynamicdns.park-your-domain.com/getip
          protocol=namecheap
          server=dynamicdns.park-your-domain.com
          login=website1.tld
          password=my_ddns_password
          cache=/var/cache/ddclient/ddclient_website1.cache
          pid=/var/run/ddclient_website1.pid
          @


          You should now be able to run systemctl enable ddclient_website1.service and systemctl start ddclient_website1.service and have ddclient begin working.






          share|improve this answer












          The issue was that I hadn't specified where the cache and the PID file were going to be located to ddclient.



          As per the --help page:



           -file path : load configuration information from 'path' (default: /etc/ddclient.conf).
          -cache path : record address used in 'path' (default: /var/cache/ddclient/ddclient.cache).
          -pid path : record process id in 'path'.


          My ExecStart command only specified -file, while I needed to also specify -cache and -pid.



          Here's my working ddclient_website1.service:



          [Unit]
          Description=DDNS client for website1.tld
          After=network.target

          [Service]
          Type=forking
          PIDFile=/var/run/ddclient_website1.pid
          ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf -pid /var/run/ddclient_website1.pid -cache /var/cache/ddclient/ddclient_website1.cache

          [Install]
          WantedBy=default.target


          You are also able to specify these paths in your configuration file for ddclient, in /etc/ddclient_website1.conf:



          daemon=1800
          use=web, web=dynamicdns.park-your-domain.com/getip
          protocol=namecheap
          server=dynamicdns.park-your-domain.com
          login=website1.tld
          password=my_ddns_password
          cache=/var/cache/ddclient/ddclient_website1.cache
          pid=/var/run/ddclient_website1.pid
          @


          You should now be able to run systemctl enable ddclient_website1.service and systemctl start ddclient_website1.service and have ddclient begin working.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 18 '16 at 23:00









          Sean Pianka

          1065




          1065




















              up vote
              0
              down vote














              [Service]
              ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf



              Using the PIDFile and the Type=forking settings in the INI file is wrong, as is the -pid option to the program. This program (as with so many) does not actually implement the relevant readiness protocol.



              The correct way to proceed, also as with so many other softwares, is to employ the program's -foreground option, which it has had since revision 113 according to its doco.



              Further reading



              • https://unix.stackexchange.com/a/476608/5132

              • https://unix.stackexchange.com/a/200365/5132





              share|improve this answer
























                up vote
                0
                down vote














                [Service]
                ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf



                Using the PIDFile and the Type=forking settings in the INI file is wrong, as is the -pid option to the program. This program (as with so many) does not actually implement the relevant readiness protocol.



                The correct way to proceed, also as with so many other softwares, is to employ the program's -foreground option, which it has had since revision 113 according to its doco.



                Further reading



                • https://unix.stackexchange.com/a/476608/5132

                • https://unix.stackexchange.com/a/200365/5132





                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote










                  [Service]
                  ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf



                  Using the PIDFile and the Type=forking settings in the INI file is wrong, as is the -pid option to the program. This program (as with so many) does not actually implement the relevant readiness protocol.



                  The correct way to proceed, also as with so many other softwares, is to employ the program's -foreground option, which it has had since revision 113 according to its doco.



                  Further reading



                  • https://unix.stackexchange.com/a/476608/5132

                  • https://unix.stackexchange.com/a/200365/5132





                  share|improve this answer













                  [Service]
                  ExecStart=/usr/sbin/ddclient -file /etc/ddclient_website1.conf



                  Using the PIDFile and the Type=forking settings in the INI file is wrong, as is the -pid option to the program. This program (as with so many) does not actually implement the relevant readiness protocol.



                  The correct way to proceed, also as with so many other softwares, is to employ the program's -foreground option, which it has had since revision 113 according to its doco.



                  Further reading



                  • https://unix.stackexchange.com/a/476608/5132

                  • https://unix.stackexchange.com/a/200365/5132






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 10 mins ago









                  JdeBP

                  30.7k464141




                  30.7k464141



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f331285%2fissues-creating-and-enabling-custom-systemd-services-for-ddclient%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay