Trying to create a systemd startup script, but it doesn't work???

General support questions
Post Reply
fribse
Posts: 11
Joined: 2017/06/06 13:25:53

Trying to create a systemd startup script, but it doesn't work???

Post by fribse » 2017/12/11 09:30:39

I would like to start mailgraph at the boot of one of our postfix servers.
mailgraph has an init script, so I've copied the init script and the perl script to /usr/local/bin and made sure they were executable.
If I run
mailgraph-init start
the daemon starts as it should.

So I created a systemd script like this:

Code: Select all

[Unit]
Description=Mailgraph Service
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/mailgraph-init
TimeoutStartSec=0

[Install]
WantedBy=default.target
And placed it in /etc/systemd/system and marked it executable.
I also tried with
ExecStart=/usr/local/bin/mailgraph-init start

But it doesn't start as it should.
I did the systemctl daemon-reload of course.

What on earth have I misunderstood about this?

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: Trying to create a systemd startup script, but it doesn't work???

Post by tunk » 2017/12/11 11:05:05

In order to start it at boot I think you also need to "enable" it:
systemctl enable mailgraph-init

Post Reply