1

I've got this service called odrived.service that I've written to be automatically started by systemd, which will in turn execte a binary file called odriveagent. It works, or I think it works, since systemctl status odrived.service does show that odriveagent is started up. However, when I try executing scripts that depend on odriveagent, the scripts print errors stating that odriveagent is not started up.

However, if I followed the tutorial of the odrive website and manually entered nohup "home/user/.odrive-agent/bin/odriveagent" > /dev/null 2>&1 & into a terminal, my scripts are able to find the started odriveagent and execute.

Is there something special about the processes started up by systemd that causes this error?

Below is my odrived.service code

[Unit]
Description=ODrive Sync Agent Daemon

[Service]
ExecStart=/home/user/.odrive-agent/bin/odriveagent

[Install]
WantedBy=multi-user.target
5
  • 1
    Are you running this service as a system service (so the process is run using the root user)? – muru Oct 1 '19 at 9:43
  • Could it be that your systemd service starts the process specified by ExecStart and it immediately exits? Does systemctl status odrived.service show an exit code? – yesno Oct 1 '19 at 9:59
  • Hi muru, I'm new to systemd and linux in general, so I'm not quite sure what you mean. I know that I haven't specified a User or Group in the odrived.service file, so the service might be running as a root by default (but I'm not sure about this) – tyrleng Oct 1 '19 at 10:02
  • Hi yesno, every thing looks fine in the systemctl status printout. The status of the service is active(running). I've seen some exit codes on a systemctl status printout before, but I don't see it in my systemctl printout for odrived.service – tyrleng Oct 1 '19 at 10:04
  • Might because your server refuse to setup the correct IPC channel when run as root. Specify User option and retry. Or try to run your client script by root. – 炸鱼薯条德里克 Oct 1 '19 at 10:22
1

I think I've found my answer with help from muru and 炸鱼薯条德里克. As they suspected, since I didn't specify a user for my odrived.service, my odrived.service ran as a root user. On the other hand, I was trying to use my client scripts as a normal user, resulting in the client scripts being unable to find the odriveagent process owned by the root user.

As 炸鱼薯条德里克 suggested, running the client scripts as a root user worked, but I think the more appropriate solution is to specify the user in the service file. Thanks for the help guys!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.