Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd service script #26

Open
shaharmor opened this issue Aug 21, 2017 · 4 comments
Open

Systemd service script #26

shaharmor opened this issue Aug 21, 2017 · 4 comments
Labels
enhancement linux For LogDNA Linux Agent

Comments

@shaharmor
Copy link

Hey, can you guys create an official systemd service script?

@noqcks
Copy link

noqcks commented Jul 26, 2018

bump?

@rotten
Copy link

rotten commented Feb 7, 2019

Here is a simple one that works for me on ubuntu 18.04. I installed logdna in /opt.

[Unit]
# /etc/systemd/system/logdna.service
# systemctl daemon-reload
# service logdna start
# service logdna stop
Description=LogDNA (remote logging) service
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/logdna-agent
PIDFile=/var/run/logdna.pid
ExecStart=/usr/bin/node index.js

[Install]
WantedBy=multi-user.target

@smusali smusali added the linux For LogDNA Linux Agent label Oct 7, 2020
@metasikander
Copy link

metasikander commented Apr 13, 2021

I modified the code @rotten shared, to work (and tested on) on fedora 33 from a standard install.

[Unit]
# /etc/systemd/system/logdna-agent.service
Description=LogDNA (remote logging) service
Requires=network.target
After=syslog.target network.target

[Service]
Type=simple
PIDFile=/var/run/logdna.pid
ExecStart=/usr/bin/logdna-agent start
ExecStop=/usr/bin/logdna-agent stop

[Install]
WantedBy=multi-user.target

@sbleon
Copy link

sbleon commented Jun 11, 2021

The installer should install a systemd service script instead of a SysV-style init script, and should include:

[Service]
Restart=on-failure

I had the agent crash and nothing restarted it. systemd can take care of that for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement linux For LogDNA Linux Agent
Projects
None yet
Development

No branches or pull requests

6 participants