Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhys committed Feb 28, 2024
1 parent 96c47f9 commit db39aca
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 11 deletions.
20 changes: 17 additions & 3 deletions fluent-package/apt/systemd-test/install-newly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,23 @@ test -e /var/log/fluent/fluentd.log
(! grep -q -e '\[warn\]' -e '\[error\]' -e '\[fatal\]' /var/log/fluent/fluentd.log)

# Test: Guard duplicated instance
(! sudo /usr/sbin/fluentd)
(! sudo /usr/sbin/fluentd -c /etc/fluent/fluentd.conf)
(! sudo /opt/fluent/bin/fluentd -c /etc/fluent/fluentd.conf)
ps -ef
COMMANDS="
/usr/sbin/fluentd
/usr/sbin/fluentd -c /etc/fluent/fluentd.conf
/opt/fluent/bin/fluentd -c /etc/fluent/fluentd.conf
"
for com in $COMMANDS; do
timeout 5 --preserve-status sudo $com
if [ $? -eq 2 ]; then
echo "Successfully blocked launching duplicated Fluentd instance: $com"
else
echo "Error: failed to block launching duplicated Fluentd instance: $com"
fi
done
#(! sudo /usr/sbin/fluentd)
#(! sudo /usr/sbin/fluentd -c /etc/fluent/fluentd.conf)
#(! sudo /opt/fluent/bin/fluentd -c /etc/fluent/fluentd.conf)

sudo apt remove -y fluent-package

Expand Down
19 changes: 15 additions & 4 deletions fluent-package/apt/systemd-test/update-from-v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,21 @@ test -e /var/log/fluent/fluentd.log
(! grep -e '\[error\]' -e '\[fatal\]' /var/log/fluent/fluentd.log)

# Test: Guard duplicated instance
(! sudo /usr/sbin/fluentd)
(! sudo /usr/sbin/td-agent)
(! sudo /usr/sbin/fluentd -c /etc/fluent/fluentd.conf)
(! sudo /opt/fluent/bin/fluentd -c /etc/fluent/fluentd.conf)
ps -ef
COMMANDS="
/usr/sbin/fluentd
/usr/sbin/td-agent
/usr/sbin/fluentd -c /etc/fluent/fluentd.conf
/opt/fluent/bin/fluentd -c /etc/fluent/fluentd.conf
"
for com in $COMMANDS; do
timeout 5 --preserve-status sudo $com
if [ $? -eq 2 ]; then
echo "Successfully blocked launching duplicated Fluentd instance: $com"
else
echo "Error: failed to block launching duplicated Fluentd instance: $com"
fi
done

# Uninstall
sudo apt remove -y fluent-package
Expand Down
23 changes: 19 additions & 4 deletions fluent-package/apt/systemd-test/update-to-next-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,25 @@ test -e /var/log/fluent/fluentd.log
(! grep -q -e '\[warn\]' -e '\[error\]' -e '\[fatal\]' /var/log/fluent/fluentd.log)

# Test: Guard duplicated instance
(! sudo /usr/sbin/fluentd)
(! sudo /usr/sbin/td-agent)
(! sudo /usr/sbin/fluentd -c /etc/fluent/fluentd.conf)
(! sudo /opt/fluent/bin/fluentd -c /etc/fluent/fluentd.conf)
ps -ef
COMMANDS="
/usr/sbin/fluentd
/usr/sbin/td-agent
/usr/sbin/fluentd -c /etc/fluent/fluentd.conf
/opt/fluent/bin/fluentd -c /etc/fluent/fluentd.conf
"
for com in $COMMANDS; do
timeout 5 --preserve-status sudo $com
if [ $? -eq 2 ]; then
echo "Successfully blocked launching duplicated Fluentd instance: $com"
else
echo "Error: failed to block launching duplicated Fluentd instance: $com"
fi
done
#(! sudo /usr/sbin/fluentd)
#(! sudo /usr/sbin/td-agent)
#(! sudo /usr/sbin/fluentd -c /etc/fluent/fluentd.conf)
#(! sudo /opt/fluent/bin/fluentd -c /etc/fluent/fluentd.conf)

# Uninstall
sudo apt remove -y fluent-package
Expand Down

0 comments on commit db39aca

Please sign in to comment.