Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Created February 28, 2014 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordansissel/9276933 to your computer and use it in GitHub Desktop.
Save jordansissel/9276933 to your computer and use it in GitHub Desktop.
[root@localhost log]# systemctl start test
[root@localhost log]# systemctl status test
test.service - Starts and stops a single Logstash instance
Loaded: loaded (/usr/lib/systemd/system/test.service; disabled)
Active: active (running) since Fri 2014-02-28 13:34:56 EST; 5s ago
Docs: http://www.elasticsearch.org
Main PID: 1214 (sleep)
CGroup: name=systemd:/system/test.service
└─1214 /usr/bin/sleep 3600
Feb 28 13:34:56 localhost.localdomain systemd[1]: Started Starts and stops a single Logstash instance.
[root@localhost log]# ps -fwwp 1214
UID PID PPID C STIME TTY TIME CMD
root 1214 1 0 13:34 ? 00:00:00 /usr/bin/sleep 3600
[root@localhost log]# systemctl stop test
[root@localhost log]# ps -fwwp 1214
UID PID PPID C STIME TTY TIME CMD
[root@localhost log]# systemctl status test
test.service - Starts and stops a single Logstash instance
Loaded: loaded (/usr/lib/systemd/system/test.service; disabled)
Active: inactive (dead) since Fri 2014-02-28 13:36:03 EST; 4s ago
Docs: http://www.elasticsearch.org
Process: 1214 ExecStart=/usr/bin/sleep 3600 (code=killed, signal=TERM)
Feb 28 13:34:56 localhost.localdomain systemd[1]: Started Starts and stops a single Logstash instance.
Feb 28 13:36:03 localhost.localdomain systemd[1]: Stopping Starts and stops a single Logstash instance...
Feb 28 13:36:03 localhost.localdomain systemd[1]: Stopped Starts and stops a single Logstash instance.
[Unit]
Description=Starts and stops a single Logstash instance
Documentation=http://www.elasticsearch.org
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/bin/sleep 3600
# See MAX_OPEN_FILES in sysconfig
LimitNOFILE=16384
TimeoutStopSec=20
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment