1

Hi I have a command like below that I use to start a server on a port and I stop it by doing Ctrl+C usign ssh

./dapperdox -spec-dir=examples/specifications/tc -bind-addr 129.19.20.55:4096

Problem is it stops after sometime. Can I convert this command to a service like

service dapperdox start/stop/restart

1 Answers1

3

Add a systemd service file e.g.

cat <<EOF | sudo tee /etc/systemd/system/dapperdox.service
[Unit]
Description=This is dapperdox
Wants=network-online.target
After=

[Service]
Type=forking
User=dapperdox
ExecStart=/sbin/startproc /full/path/to/dapperdox -spec-dir=examples/specifications/tc -bind-addr 129.19.20.55:4096
ExecStop=/sbin/killproc -TERM /full/path/to/dapperdox

[Install]
WantedBy=multi-user.target

EOF

Now try if you can start it.

sudo systemctl start dapperdox.service

Adjust the different things as you need them.

Afterwards you want to enable it so it starts during boot.

sudo systemctl enable dapperdox.service
Ziazis
  • 2,174