0

I made a system service on remote VM that should start on boot as suggested here:

[Unit]
Description={removed}
Wants=network-online.target
After=network-online.target

[Service]
User={my username}
ExecStart=/usr/bin/bash -c "{access remote repo, pull code to a folder in my home directory, run with personal tokens}"
Restart=on-failure

[Install]
WantedBy=multi-user.target

This fails to run on startup, throwing the following errors:

service.service: Failed to determine user credentials: Resource temporarily unavailable
service.service: Failed at step USER spawning /usr/bin/bash: Resource temporarily unavailable
service.service: Main process exited, code=exited, status=217/USER
service.service: Failed with result 'exit-code'.

The service, however, can be successfully run manually.

What i the cause of this behavior and how to fix it?

4
  • What are the actual commands? You can use something as a placeholder for the credentials. Commented Aug 11, 2024 at 23:55
  • I will not disclose the actual commands for privacy reasons. However, it does not seem to be relevant to the case anyway, as, judging by second error message, the issue arises before bash script can be executed. Commented Aug 12, 2024 at 0:07
  • have you read all the suggestions in this question - I know that question is apparently about opendkim, however, most of the answers are not specific to that - the answer that caught my attention was regarding "active directory" - if that is appropriate to your system, then there's an answer there Commented Aug 12, 2024 at 1:09
  • That's up to you but you could have just used special characters like ##### to block out anything that is sensitive such as a password. For example command --password #####. Perhaps the commands didn't matter this time but if you are going to ask for help, then that's rather difficult if not impossible to do when information isn't available. Commented Aug 12, 2024 at 11:33

1 Answer 1

0

Figured out a solution: since I was using my personal directory for the service, I had enabled lingering (sudo loginctl enable-linger <my username>). So I added my user service to requirements (Wants=<user service>, After=<user service>, user service can be viewed via loginctl show-user <username>), now it works on boot.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.