7

I have a systemd unit which failed, and I'm not sure what the result type is supposed to mean.

Active: failed (Result: resources) since Thu 2016-11-17 21:06:42 UTC; 32min ago

What does Result: resources mean? I'm familiar with Result: exit-code, but not this one.

2rs2ts
  • 707

2 Answers2

4

I agree that it is quite generic error message. Since I am not sure when you get this message I am sending you the necessary information so you can find it yourself but it can be the interpretation of errnos of system calls, ex ENOMEM.

Follow SERVICE_FAILURE_RESOURCES in https://github.com/systemd/systemd/blob/2e6dbc0fcd45c152f15aed77cde4fd07957c150c/src/core/service.c.

Umut
  • 156
  • Thanks for this. I looked into the source and it seems that it's a generic failure message, which is definitely not helpful given that I didn't even get any journalctl messages... https://github.com/systemd/systemd/blob/7d78f7cea82dc7b4ced77f86a05124add2509390/src/core/service.h#L83 "a bit of a misnomer, just our catch-all error for errnos we didn't expect" – 2rs2ts Nov 18 '16 at 19:54
  • 1
    Notice that before going in to this state, we always print out something to the syslogs where we should be printing something about the error code. Example, https://github.com/systemd/systemd/blob/2e6dbc0fcd45c152f15aed77cde4fd07957c150c/src/core/service.c#L1941 – Umut Nov 21 '16 at 06:50
0

Not sure, if this helps, but I got this message on Ubuntu when I placed the .service files under /etc/systemd/system. After obtaining a directory listing, I noticed that there weren't any individual service files there. Everything was either links to service files udner /lib/systemd/system, or directories like paths.target.wants - ending on .wants

Will post an update, if I manage to resolve this. It appears I need to

  1. Move the .service files under /lib/systemd/system
  2. Create symlinks from /etc/systemd/system pointing to /lib/systemd/system

===

OK, solved it. I did (1) and (2) above, but that was not the issue. In one of my Unit files, in the [Service] section I have:

EnvironmentFile=/etc/concourse/web_env

Well, turned out I created the /etc/concourse directory, but did NOT move the web_env configuration file, which the cocnourse-web.service needs to function properly. Hence, "resources" ... error in systemd, because the service (in this case Concourse CI Web Node) could not find its web_env configuration file.

Hope this helps you solve your issue, and good luck, of course. Here is a screenshot for more clarity: Unit file for Concourse Web Node

  • 1
    There weren't any individual service files because you haven't placed any of them there. That's literally the purpose of /etc/systemd – to hold custom local services, not to hold packaged services (which go in /lib). – u1686_grawity Jun 13 '23 at 08:29
  • Thank you for your comment. I created the service manually, but I guess the tutorial I was following was wrong. Normally, with packaged software, the package manager copies service files in the proper locations. – George Smith Jun 13 '23 at 08:52
  • Here is a link to the tutorial: https://serverspace.us/support/help/installing-concourse-ci/. Notice there is line that reads: vim /etc/systemd/system/concourse-web.service In a bizarre manner, the author also tries to start a systemctl service with "service start" – George Smith Jun 13 '23 at 08:56
  • I made exactly the same mistake of not putting the env file in the right path while also configuring a concourse worker on a VM, what are the chances :) – Kartik Shah Mar 27 '24 at 02:32