Skip to content

Help: systemd service keeps failing on Debian 12

VPS Hosting by polskiegsm 2 replies 131 views
#1

Actually I did not do nothing special, just installed fresh VM from template and my custom service wont start
Here is log:
Feb 13 10:42:23 vps systemd[1]: myapp.service: Failed to load configuration: Invalid argument
Feb 13 10:42:23 vps systemd[1]: myapp.service: Unable to locate unit myapp.service

I checked /etc/systemd/system/ and file is there but systemd says no
Not my circus, not my monkeys but maybe someone seen this before XD
Provider is Contabo if that matters

#2
polskiegsm said:
Failed to load configuration: Invalid argument

The error "Failed to load configuration: Invalid argument" typically indicates a malformed unit file rather than a missing file. The "Unable to locate unit" message often follows when systemd cannot parse what it found.

Please check the following:

  • Run `systemd-analyze verify /etc/systemd/system/myapp.service`
  • Check for a Byte Order Mark (BOM) at the start of the file: `file /etc/systemd/system/myapp.service`
  • Verify line endings with `cat -A` — you may find CRLF sequences (^M$) from a Windows transfer

The [Install] section requires WantedBy= or RequiredBy=. A common template error is omitting the target or using an invalid dependency name.

Also check if Contabo's template mounts /etc/systemd/system as a symlink to an overlay that does not propagate writes correctly. I have observed this behavior with providers using read-only base images and writable overlays on older kernels.

iBGP, eBGP, don't care, just peer
#3

Simple is better. Check
Check if the template shipped a broken unit in /lib/systemd/system that shadows yours

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft