leamas / ddupdate

Update DNS Data for Dynamic IP Addresses
MIT License
40 stars 28 forks source link

[bug] systemd unit files: wrong path #69

Closed atesin closed 1 year ago

atesin commented 1 year ago

hi.... need to migrate my ddns services (afraid.org v2 token) from openwrt router to my linux box... i used to use ddclient but ddupdate looks good and idecided to give it a try

i just installed ddupdate (fedora 33, dnf) and try to write a new service plugin (see my other isssue)... then do some command line tests that seem to work ok, and then tried to install the system with ddupdate-config

it doesn't work... and journalctl -xe shows messages like

ddupdate: ddupdate.service: Failed to execute command: No such file or directory
systemd: ddupdate.service: Failed at step EXEC spawning /usr/lib/python3.9/ddupdate: No such file or directory

so with rpm -ql ddupdate i noticed the files "ddupdate.service" and "ddupdate.timer" in directory /usr/share/doc/ddupdate

.... so i also suspect systemd doesn't look that directory, so it doesn't know the unit files exists...

... i am a little confused, i don't know what's wrong with the files... what would be the right thing to do?

atesin commented 1 year ago

... ehh ... i saw this closed issue #54 ... i think i suffer this problem because fedora package is version 0.6.5 and this patch comes later

... well since i am affected to this... how can i "patch" this issue in place? .. i am trying to do...

rsync -av ~/.config/systemd /usr/lib/
rm -fr ~/.config/systemd
cd /usr/lib/systemd/user/timers.target.wants
ln -sf ../ddupdate.timer

... and run ddupdate-config again, but doesn't seem to work :/

atesin commented 1 year ago

for some reason, systemd user configuration didn'd work for me... but does system wide configuration (is what i want anyway)... with this similar procedure

rsync -av ~/.config/systemd/user/* /etc/systemd/system/
rm -fr ~/.config/systemd  # optional
cd /etc/systemd/system/timers.target.wants
ln -sf ../ddupdate.timer
vim ../ddupdate.service
# replace this
# --- ExecStart=/usr/lib/python3.9/ddupdate
# +++ ExecStart=/usr/bin/ddupdate
systemctl daemon-reload

at this point you can enable, start, view status or whatever you want with service unit

.... i hope other users like me with this problem could read this in the near future

leamas commented 1 year ago

.. i hope other users like me with this problem could read this in the near future

Actually, I hope not. ddupdate is specifically designed to run as a user service, and that's the way it should work. To run it as a system-wide service is deprecated for many reasons, the most important are about security.

If you get the message ddupdate.service: Failed to execute command: No such file or directory after running for example systemctl --user status ddupdate.service it basically means that the file ~/.config/systemd/user/ddupdate.service is missing for whatever reason. It could be installed manually, but is normally put in place by ddupdate-config, at least as an initial configuration.

Here are no "wrong paths" whatsoever. The files under /usr/share are just templates used by ddupdate-config which eventually are installed at correct locations.

Please don't report issues on your current setup, as I stated earlier it is deprecated. Please also follow up on #57 so we can close that discussion.

Can we now close this issue?

leamas commented 1 year ago

BTW:

i just installed ddupdate (fedora 33, dnf)

Fedora 33 is severely outdated and not supported by Fedora and thus not by ddupdate. You should update your system, Fedora have a quite fast release cycle but updates tends to work well. Personally, I am on Fedora 36.

atesin commented 1 year ago

i will consider your advice..... please remark users before posting issues, to check his ddupdate version and the bug is not yet fixed for latest version