-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CPACK: add auto generated dbhelper maintainer scripts
Signed-off-by: ahspw <[email protected]>
- Loading branch information
ahspw
committed
Jan 2, 2024
1 parent
3a308f3
commit 561bd2f
Showing
6 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/sh | ||
|
||
### BEGIN INIT INFO | ||
# Provides: fluent-bit | ||
# Required-Start: $local_fs $remote_fs $network $syslog $named | ||
# Required-Stop: $local_fs $remote_fs $network $syslog $named | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: starts the fluent-bit service | ||
# Description: starts fluent-bit using start-stop-daemon | ||
### END INIT INFO | ||
|
||
PATH=/opt/fluent-bit/bin/:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
DAEMON=/opt/fluent-bit/bin/fluent-bit | ||
NAME=fluent-bit | ||
DESC=fluent-bit | ||
|
||
start_fluent_bit() { | ||
# Start the daemon/service | ||
# | ||
# Returns: | ||
# 0 if daemon has been started | ||
# 1 if daemon was already running | ||
# 2 if daemon could not be started | ||
start-stop-daemon --start --quiet --exec $DAEMON 2>/dev/null || return 2 | ||
} | ||
|
||
test_config() { | ||
# Test the fluent_bit configuration | ||
$DAEMON --dry-run -c /etc/fluent-bit/fluent-bit.conf | ||
} | ||
|
||
stop_fluent_bit() { | ||
# Stops the daemon/service | ||
# | ||
# Return | ||
# 0 if daemon has been stopped | ||
# 1 if daemon was already stopped | ||
# 2 if daemon could not be stopped | ||
# other if a failure occurred | ||
start-stop-daemon --stop --quiet --name $NAME | ||
} | ||
|
||
case "$1" in | ||
start) | ||
start_fluent_bit | ||
;; | ||
stop) | ||
stop_fluent_bit | ||
;; | ||
restart) | ||
|
||
# Check configuration before stopping fluent_bit | ||
if ! test_config; then | ||
exit $? | ||
fi | ||
|
||
stop_fluent_bit | ||
case "$?" in | ||
0|1) | ||
start_fluent_bit | ||
;; | ||
*) | ||
# Failed to stop | ||
;; | ||
esac | ||
;; | ||
configtest|testconfig) | ||
test_config | ||
;; | ||
*) | ||
echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest}" >&2 | ||
exit 3 | ||
;; | ||
esac | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
case "${1}" in | ||
configure) | ||
chmod +x /etc/init.d/fluent-bit | ||
;; | ||
|
||
abort-upgrade|abort-remove|abort-deconfigure) | ||
|
||
;; | ||
|
||
*) | ||
echo "postinst called with unknown argument \`${1}'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Automatically added by dh_installinit/12.10 | ||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
if [ -x "/etc/init.d/fluent-bit" ]; then | ||
update-rc.d fluent-bit defaults >/dev/null | ||
if [ -n "$2" ]; then | ||
_dh_action=restart | ||
else | ||
_dh_action=start | ||
fi | ||
invoke-rc.d fluent-bit $_dh_action || exit 1 | ||
fi | ||
fi | ||
# End automatically added section | ||
|
||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
case "${1}" in | ||
remove) | ||
|
||
;; | ||
|
||
purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) | ||
|
||
;; | ||
|
||
*) | ||
echo "postrm called with unknown argument \`${1}'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Automatically added by dh_installinit/12.10 | ||
if [ "$1" = "purge" ] ; then | ||
update-rc.d fluent-bit remove >/dev/null | ||
fi | ||
# End automatically added section | ||
|
||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
set -e | ||
# Automatically added by dh_installinit/12.10 | ||
if [ -x "/etc/init.d/fluent-bit" ] && [ "$1" = remove ]; then | ||
invoke-rc.d fluent-bit stop || exit 1 | ||
fi | ||
# End automatically added section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters