Issues creating and enabling custom systemd services for ddclient
Clash 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 .service
files 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 touch
ed ddclient_website1.pid
(also for website2) into /var/run
and achieved the same result.
ubuntu systemd services
add a comment |Â
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 .service
files 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 touch
ed ddclient_website1.pid
(also for website2) into /var/run
and achieved the same result.
ubuntu systemd services
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
add a comment |Â
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 .service
files 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 touch
ed ddclient_website1.pid
(also for website2) into /var/run
and achieved the same result.
ubuntu systemd services
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 .service
files 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 touch
ed ddclient_website1.pid
(also for website2) into /var/run
and achieved the same result.
ubuntu systemd services
ubuntu systemd services
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
add a comment |Â
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
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
0
down vote
This may related, try changing the [Install]
section to
[Install]
WantedBy=default.target
The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled asforking
), 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 theddclient
? (ddclient -daemon=0 -noquiet -debug
)
â Rabin
Dec 18 '16 at 21:17
add a comment |Â
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.
add a comment |Â
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
add a comment |Â
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
The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled asforking
), 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 theddclient
? (ddclient -daemon=0 -noquiet -debug
)
â Rabin
Dec 18 '16 at 21:17
add a comment |Â
up vote
0
down vote
This may related, try changing the [Install]
section to
[Install]
WantedBy=default.target
The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled asforking
), 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 theddclient
? (ddclient -daemon=0 -noquiet -debug
)
â Rabin
Dec 18 '16 at 21:17
add a comment |Â
up vote
0
down vote
up vote
0
down vote
This may related, try changing the [Install]
section to
[Install]
WantedBy=default.target
This may related, try changing the [Install]
section to
[Install]
WantedBy=default.target
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 asforking
), 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 theddclient
? (ddclient -daemon=0 -noquiet -debug
)
â Rabin
Dec 18 '16 at 21:17
add a comment |Â
The issue is no longer that it doesn't start (that was an issue with the type of the service not being labelled asforking
), 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 theddclient
? (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
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered Dec 18 '16 at 23:00
Sean Pianka
1065
1065
add a comment |Â
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
[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
answered 10 mins ago
JdeBP
30.7k464141
30.7k464141
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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