Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Change to systemd type simple #165

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 3 additions & 4 deletions templates/etc/systemd/td-agent.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ Environment=FLUENT_CONF=/etc/<%= project_name %>/<%= project_name %>.conf
Environment=FLUENT_PLUGIN=/etc/<%= project_name %>/plugin
Environment=FLUENT_SOCKET=/var/run/<%= project_name %>/<%= project_name %>.sock
Environment=TD_AGENT_OPTIONS=
PIDFile=<%= Shellwords.shellescape(File.join(root_path, "var", "run", project_name, "#{project_name}.pid")) %>
RuntimeDirectory=<%= Shellwords.shellescape(project_name) %>
Type=forking
ExecStart=/opt/td-agent/embedded/bin/fluentd --log <%= Shellwords.shellescape(File.join(root_path, "var", "log", project_name, "#{project_name}.log")) %> --daemon <%= Shellwords.shellescape(File.join(root_path, "var", "run", project_name, "#{project_name}.pid")) %> $TD_AGENT_OPTIONS
ExecStop=/bin/kill -TERM ${MAINPID}
Type=simple
ExecStart=/opt/td-agent/embedded/bin/fluentd --log <%= Shellwords.shellescape(File.join(root_path, "var", "log", project_name, "#{project_name}.log")) %> $TD_AGENT_OPTIONS
ExecReload=/bin/kill -HUP ${MAINPID}
Restart=always
TimeoutStopSec=120
KillMode=mixed

[Install]
WantedBy=multi-user.target