Skip to content

systemd Service File for POCO ServerApplication

Günter Obiltschnig edited this page Jun 6, 2020 · 2 revisions

Here is a template for a systemd service file for a server application based on Poco::Util::ServerApplication (contributed by Jeff Adams):

pocoServiceExample.service

[Unit]
Description=Best Darn Poco Service Ever
After=network.target

[Service]
Type=forking
PIDFile=/var/run/THEPRODUCT/THEBINARY.pid
User=THEUSER
Group=THEGROUP
EnvironmentFile=-/opt/THEPRODUCT/etc/THEBINARY
Environment=LD_LIBRARY_PATH=/opt/THEPRODUCT/lib:$LD_LIBRARY_PATH
ExecStart=/opt/THEPRODUCT/bin/THEBINARY --daemon --pidfile=/var/run/THEPRODUCT/THEBINARY.pid --logdir=/var/log/THEPRODUCT $THE_OPTS
Restart=on-abort

[Install]
WantedBy=multi-user.target