Skip to content

Commit

Permalink
Simplify unit files and stop container on config error
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaircloth-splunk committed Jun 13, 2020
1 parent f467d63 commit b1b3a65
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
9 changes: 2 additions & 7 deletions docs/gettingstarted/docker-systemd-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,8 @@ Environment="SC4S_LOCAL_CONFIG_MOUNT=-v /opt/sc4s/local:/opt/syslog-ng/etc/conf.
TimeoutStartSec=0
Restart=always

ExecStartPre=/usr/bin/docker pull $SC4S_IMAGE
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment SC4SHOST=$(hostname -s)"
ExecStartPre=/usr/bin/docker run \
--env-file=/opt/sc4s/env_file \
"$SC4S_LOCAL_CONFIG_MOUNT" \
--name SC4S_preflight \
--rm $SC4S_IMAGE -s
ExecStart=/usr/bin/docker run -p 514:514 -p 514:514/udp -p 6514:6514 \
ExecStart=/usr/bin/docker run –pull=always -p 514:514 -p 514:514/udp -p 6514:6514 \
-e "SC4S_CONTAINER_HOST=${SC4SHOST}" \
--env-file=/opt/sc4s/env_file \
"$SC4S_PERSIST_VOLUME" \
Expand All @@ -68,6 +62,7 @@ ExecStart=/usr/bin/docker run -p 514:514 -p 514:514/udp -p 6514:6514 \
"$SC4S_TLS_DIR" \
--name SC4S \
--rm $SC4S_IMAGE
Restart=on-success
```

* Execute the following command to create a local volume that will contain the disk buffer files in the event of a communication
Expand Down
10 changes: 2 additions & 8 deletions docs/gettingstarted/podman-systemd-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,8 @@ Environment="SC4S_LOCAL_CONFIG_MOUNT=-v /opt/sc4s/local:/opt/syslog-ng/etc/conf.
TimeoutStartSec=0
Restart=always

ExecStartPre=/usr/bin/podman pull $SC4S_IMAGE
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment SC4SHOST=$(hostname -s)"
ExecStartPre=/usr/bin/podman run \
--env-file=/opt/sc4s/env_file \
"$SC4S_LOCAL_CONFIG_MOUNT" \
--name SC4S_preflight \
--rm $SC4S_IMAGE -s
ExecStart=/usr/bin/podman run -p 514:514 -p 514:514/udp -p 6514:6514 \
ExecStart=/usr/bin/podman run –pull=always -p 514:514 -p 514:514/udp -p 6514:6514 \
-e "SC4S_CONTAINER_HOST=${SC4SHOST}" \
--env-file=/opt/sc4s/env_file \
"$SC4S_PERSIST_VOLUME" \
Expand All @@ -86,7 +80,7 @@ ExecStart=/usr/bin/podman run -p 514:514 -p 514:514/udp -p 6514:6514 \
"$SC4S_TLS_DIR" \
--name SC4S \
--rm $SC4S_IMAGE
ExecStartPost=sleep 2 ; conntrack -D -p udp
Restart=on-successck -D -p udp
```

* Execute the following command to create a local volume that will contain the disk buffer files in the event of a communication
Expand Down
1 change: 1 addition & 0 deletions package/etc/conf.d/filters/cisco/cisco_syslog.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ filter f_is_cisco_syslog{
};

parser cisco-parser-ex{
x
channel {
if {
#Cisco IOS-XR devices with node-id format
Expand Down
8 changes: 8 additions & 0 deletions package/sbin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ echo syslog-ng starting

/opt/syslog-ng/sbin/syslog-ng $@ &
pid="$!"
sleep 5
if ! ps -p $pid > /dev/null
then
echo "syslog-ng failed to start $pid is not running"
exit 99
# Do something knowing the pid exists, i.e. the process with $PID is running
fi

# wait forever
if [[ $@ != *"-s"* ]]; then
while true
Expand Down

0 comments on commit b1b3a65

Please sign in to comment.