Skip to content

Instantly share code, notes, and snippets.

@vxgmichel
Created September 5, 2016 13:03
Show Gist options
  • Save vxgmichel/b60cab67cf45298a9c1b98d01159e743 to your computer and use it in GitHub Desktop.
Save vxgmichel/b60cab67cf45298a9c1b98d01159e743 to your computer and use it in GitHub Desktop.
tango-db systemd service
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to create a file "/etc/systemd/system/tango-db.service",
# containing
# .include /lib/systemd/system/tango-db.service
# ...make your changes here...
# or create a file "/etc/systemd/system/tango-db.service.d/foo.conf",
# which doesn't need to include ".include" call and which will be parsed
# after the file tango-db.service itself is parsed.
#
# For more info about custom unit files, see systemd.unit(5) or
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
# Note: /usr/lib/... is recommended in the .include line though /lib/...
# still works.
# Don't forget to reload systemd daemon after you change unit configuration:
# root> systemctl --system daemon-reload
[Unit]
Description=Tango database server
Requires=mariadb.service
After=mariadb.service
[Service]
Type=simple
User=tangosys
Group=tangosys
# find the TANGO_HOST setting
EnvironmentFile=/etc/tangorc
# read db credentials
# TODO: could this be handled differently; e.g through a .my.cnf file in tangosys home dir?
EnvironmentFile=/etc/sysconfig/tango-db
ExecStart=/usr/bin/DataBaseds 2 -ORBendPoint giop:tcp:${TANGO_HOST}
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=10
# Place temp files in a secure directory, not /tmp
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment