Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions tools/turbinia@.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This file should be in /etc/systemd/system/turbinia@.service.
# The @ symbol in the filename is important, which marks the file
# a systemd template unit file.
#
# Systemd supports service instantiations from a single template file.
# This service file will serve as a template from which two units will
# be instantiated as "server" and "psqworker".
#
# Systemd naming convention for an instantiated service unit:
# <service_name>@<argument>.service
#
# <argument> is passed to systemd and then assigned to %i.
#
# To manage services for Turbinia:
# sudo systemctl enable turbinia@server
# sudo systemctl enable turbinia@psqworker
# sudo systemctl status turbinia@server
# sudo systemctl status turbinia@psqworker
# sudo systemctl start turbinia@server
# sudo systemctl start turbinia@psqworker
# sudo systemctl stop turbinia@server
# sudo systemctl stop turbinia@psqworker
# sudo systemctl daemon-reload


[Unit]
Description=Turbinia %i Daemon
Documentation=https://github.com/google/turbinia
Before=multi-user.target
After=network.target
After=remote-fs.target


[Service]
Type=simple
PIDFile=/var/run/turbinia-%i.pid
User=turbinia
Group=turbinia
Restart=always
RestartSec=10
ExecStartPre=+/bin/sh -c '/bin/systemctl set-environment GOOGLE_APPLICATION_CREDENTIALS=$(turbinia_config_parser.py GCE_SERVICE_ACCOUNT_KEYS_FILE)'
ExecStartPre=+/bin/sh -c '/bin/systemctl set-environment TURBINIA_TMPDIR=$(turbinia_config_parser.py TMP_DIR)'
ExecStart=/bin/sh -c '/usr/local/turbinia/turbiniactl -L $TURBINIA_TMPDIR/turbinia-%i.log -S -o $TURBINIA_TMPDIR %i 2>> $TURBINIA_TMPDIR/turbinia-%i.stdout.log'
ExecStopPost=+/bin/sh -c 'systemctl unset-environment TURBINIA_TMPDIR'
ExecStopPost=+/bin/sh -c 'systemctl unset-environment GOOGLE_APPLICATION_CREDENTIALS'
KillMode=control-group
KillSignal=SIGINT


[Install]
WantedBy=multi-user.target