Skip to content

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!

2 points4 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 100% up
Kind
Text
ID
4liqq2

Author

4
posts
79
comments
0
media
View profile

5 comments

Is rmmagentd --start is a script that starts some daemon in the background? By default ExecStart= needs to be a foreground process. You can try adding Type=forking for processes that daemonize or Type=oneshot and RemainAfterExit=true for processes that exit.

6 points
unknown author

Deleted before we saved it.

1 points

not at a computer to test, but you did not specify type (onshot, fork, etc)

1 points

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.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.