Help with Systemd Unit File
Hi all, I'm practicing creating my own systemd unit file that I can use to issue commands for starting and stopping a program as well as automatically start it at boot.
I've read a bunch of articles, including a few example files, and this is what I've come up with so far:
[Unit]
Description=Languard Remote Management Agent
[Service]
TimeoutStartSec=0
ExecStart=/usr/rmmagent/rmmagentd --start
ExecStop=/usr/rmmagent/rmmagentd --terminate
[Install]
WantedBy=multi-user.target
Well, I'm here because it doesn't work... Obviously I can issue those commands in the terminal manually with no problem; those work fine. Am I missing a point with systemd's functionality, or do I have a problem with my syntax or what?
Thanks!
About this post
- Posted
- Archived
- Score
- 2 · 100% up
- Kind
- Text
- ID
- 4liqq2
5 comments
Is
rmmagentd --startis a script that starts some daemon in the background? By defaultExecStart=needs to be a foreground process. You can try addingType=forkingfor processes that daemonize orType=oneshotandRemainAfterExit=truefor processes that exit.This could be the problem. The default type is "simple"
https://n0where.net/understanding-systemd/
Deleted before we saved it.
not at a computer to test, but you did not specify type (onshot, fork, etc)
As noted, the unit does need to specify a Type. Also, some service binaries expect to attach to a TTY, and may segfault if not given one. Take a look at the TTYPath directive if errors to that effect appear in the journal.