diff --git a/README.md b/README.md index d5a51cc..6fcb49d 100644 --- a/README.md +++ b/README.md @@ -218,8 +218,8 @@ The service definitions are also available via a tarball which can be manually i tedgectl enable c8y-configuration-plugin tedgectl start c8y-configuration-plugin - tedgectl enable c8y-log-plugin - tedgectl start c8y-log-plugin + tedgectl enable tedge-log-plugin + tedgectl start tedge-log-plugin tedgectl enable c8y-firmware-plugin tedgectl start c8y-firmware-plugin diff --git a/images/check.sh b/images/check.sh index 16ba0fb..06062aa 100755 --- a/images/check.sh +++ b/images/check.sh @@ -33,7 +33,7 @@ start_enable tedge-agent #start_enable tedge-mapper-c8y "tedge-mapper c8y" #start_enable c8y-configuration-plugin #start_enable c8y-firmware-plugin -#start_enable c8y-log-plugin +#start_enable tedge-log-plugin echo "" echo "Tests passed" diff --git a/packages/_scripts/postinstall.sh b/packages/_scripts/postinstall.sh index 6a7444e..3067ef4 100755 --- a/packages/_scripts/postinstall.sh +++ b/packages/_scripts/postinstall.sh @@ -38,9 +38,9 @@ if command -V c8y-configuration-plugin >/dev/null 2>&1; then tedgectl start c8y-configuration-plugin 2>/dev/null ||: fi -if command -V c8y-log-plugin >/dev/null 2>&1; then - tedgectl enable c8y-log-plugin ||: - tedgectl start c8y-log-plugin 2>/dev/null ||: +if command -V tedge-log-plugin >/dev/null 2>&1; then + tedgectl enable tedge-log-plugin ||: + tedgectl start tedge-log-plugin 2>/dev/null ||: fi if command -V c8y-firmware-plugin >/dev/null 2>&1; then diff --git a/packages/_scripts/preremove.sh b/packages/_scripts/preremove.sh index d212339..7c4698e 100755 --- a/packages/_scripts/preremove.sh +++ b/packages/_scripts/preremove.sh @@ -5,12 +5,12 @@ set -e tedgectl disable tedge-agent 2>/dev/null ||: tedgectl disable tedge-mapper-c8y 2>/dev/null ||: tedgectl disable c8y-configuration-plugin 2>/dev/null ||: -tedgectl disable c8y-log-plugin 2>/dev/null ||: +tedgectl disable tedge-log-plugin 2>/dev/null ||: tedgectl disable c8y-firmware-plugin 2>/dev/null ||: # stop services (ignore if not found) tedgectl stop tedge-agent 2>/dev/null ||: tedgectl stop tedge-mapper-c8y 2>/dev/null ||: tedgectl stop c8y-configuration-plugin 2>/dev/null ||: -tedgectl stop c8y-log-plugin 2>/dev/null ||: +tedgectl stop tedge-log-plugin 2>/dev/null ||: tedgectl stop c8y-firmware-plugin 2>/dev/null ||: diff --git a/services/openrc/conf.d/c8y-log-plugin b/services/openrc/conf.d/tedge-log-plugin similarity index 56% rename from services/openrc/conf.d/c8y-log-plugin rename to services/openrc/conf.d/tedge-log-plugin index 47706cf..b0dce69 100644 --- a/services/openrc/conf.d/c8y-log-plugin +++ b/services/openrc/conf.d/tedge-log-plugin @@ -1,6 +1,6 @@ -# Configuration file for /etc/init.d/c8y-log-plugin +# Configuration file for /etc/init.d/tedge-log-plugin -# Additional arguments to pass to /usr/bin/c8y-log-plugin. +# Additional arguments to pass to /usr/bin/tedge-log-plugin. #command_args= # Overwrite user diff --git a/services/openrc/init.d/c8y-log-plugin b/services/openrc/init.d/tedge-log-plugin similarity index 80% rename from services/openrc/init.d/c8y-log-plugin rename to services/openrc/init.d/tedge-log-plugin index 3b5374a..283749d 100755 --- a/services/openrc/init.d/c8y-log-plugin +++ b/services/openrc/init.d/tedge-log-plugin @@ -1,6 +1,6 @@ #!/sbin/openrc-run -description="Thin-edge logfile retriever for Cumulocity" -command="/usr/bin/c8y-log-plugin" +description="thin-edge.io log file retriever" +command="/usr/bin/tedge-log-plugin" : ${command_args=} : ${command_user=root} pidfile="/run/lock/${RC_SVCNAME}.lock" diff --git a/services/runit/runsvdir/c8y-log-plugin/run b/services/runit/runsvdir/c8y-log-plugin/run deleted file mode 100755 index f71a587..0000000 --- a/services/runit/runsvdir/c8y-log-plugin/run +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -e -touch "/var/log/c8y-log-plugin.log" -DAEMON_USER="root" -LOG_FILE="/var/log/c8y-log-plugin.log" -PIDFILE="/run/lock/c8y-log-plugin.lock" - -mkdir -p /run/lock -chown 1777 /run/lock -touch "$PIDFILE" - -if [ -n "$DAEMON_USER" ]; then - chown "$DAEMON_USER" "$PIDFILE" - chown "$DAEMON_USER" "/var/log/c8y-log-plugin.log" -fi -exec chpst -u "$DAEMON_USER" "/usr/bin/c8y-log-plugin" >> "$LOG_FILE" 2>&1 diff --git a/services/runit/runsvdir/tedge-log-plugin/run b/services/runit/runsvdir/tedge-log-plugin/run new file mode 100755 index 0000000..7bb0c65 --- /dev/null +++ b/services/runit/runsvdir/tedge-log-plugin/run @@ -0,0 +1,15 @@ +#!/bin/sh -e +touch "/var/log/tedge-log-plugin.log" +DAEMON_USER="root" +LOG_FILE="/var/log/tedge-log-plugin.log" +PIDFILE="/run/lock/tedge-log-plugin.lock" + +mkdir -p /run/lock +chown 1777 /run/lock +touch "$PIDFILE" + +if [ -n "$DAEMON_USER" ]; then + chown "$DAEMON_USER" "$PIDFILE" + chown "$DAEMON_USER" "/var/log/tedge-log-plugin.log" +fi +exec chpst -u "$DAEMON_USER" "/usr/bin/tedge-log-plugin" >> "$LOG_FILE" 2>&1 diff --git a/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/consumer-for b/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/consumer-for deleted file mode 100644 index 3133cba..0000000 --- a/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/consumer-for +++ /dev/null @@ -1 +0,0 @@ -c8y-log-plugin \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/pipeline-name b/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/pipeline-name deleted file mode 100644 index a23d6d3..0000000 --- a/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/pipeline-name +++ /dev/null @@ -1 +0,0 @@ -c8y-log-plugin-pipeline \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/run b/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/run deleted file mode 100755 index 29663dc..0000000 --- a/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -sed 's/^/\x1b[34mc8y-log-plugin |\x1b[0m /' --unbuffered \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/c8y-log-plugin/producer-for b/services/s6-overlay/s6-rc.d/c8y-log-plugin/producer-for deleted file mode 100644 index facdc58..0000000 --- a/services/s6-overlay/s6-rc.d/c8y-log-plugin/producer-for +++ /dev/null @@ -1 +0,0 @@ -c8y-log-plugin-log \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/consumer-for b/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/consumer-for new file mode 100644 index 0000000..4be0923 --- /dev/null +++ b/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/consumer-for @@ -0,0 +1 @@ +tedge-log-plugin \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/pipeline-name b/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/pipeline-name new file mode 100644 index 0000000..27ef4d4 --- /dev/null +++ b/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/pipeline-name @@ -0,0 +1 @@ +tedge-log-plugin-pipeline \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/run b/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/run new file mode 100755 index 0000000..4fb792e --- /dev/null +++ b/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/run @@ -0,0 +1,2 @@ +#!/bin/sh +sed 's/^/\x1b[34mtedge-log-plugin |\x1b[0m /' --unbuffered \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/c8y-log-plugin-log/type b/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/type similarity index 100% rename from services/s6-overlay/s6-rc.d/c8y-log-plugin-log/type rename to services/s6-overlay/s6-rc.d/tedge-log-plugin-log/type diff --git a/services/s6-overlay/s6-rc.d/c8y-log-plugin/dependencies.d/base b/services/s6-overlay/s6-rc.d/tedge-log-plugin/dependencies.d/base similarity index 100% rename from services/s6-overlay/s6-rc.d/c8y-log-plugin/dependencies.d/base rename to services/s6-overlay/s6-rc.d/tedge-log-plugin/dependencies.d/base diff --git a/services/s6-overlay/s6-rc.d/tedge-log-plugin/producer-for b/services/s6-overlay/s6-rc.d/tedge-log-plugin/producer-for new file mode 100644 index 0000000..9d0270d --- /dev/null +++ b/services/s6-overlay/s6-rc.d/tedge-log-plugin/producer-for @@ -0,0 +1 @@ +tedge-log-plugin-log \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/c8y-log-plugin/run b/services/s6-overlay/s6-rc.d/tedge-log-plugin/run similarity index 53% rename from services/s6-overlay/s6-rc.d/c8y-log-plugin/run rename to services/s6-overlay/s6-rc.d/tedge-log-plugin/run index 9fe5148..1af9c50 100755 --- a/services/s6-overlay/s6-rc.d/c8y-log-plugin/run +++ b/services/s6-overlay/s6-rc.d/tedge-log-plugin/run @@ -1,3 +1,3 @@ #!/command/with-contenv sh exec 2>&1 -exec /usr/bin/c8y-log-plugin +exec /usr/bin/tedge-log-plugin diff --git a/services/s6-overlay/s6-rc.d/c8y-log-plugin/type b/services/s6-overlay/s6-rc.d/tedge-log-plugin/type similarity index 100% rename from services/s6-overlay/s6-rc.d/c8y-log-plugin/type rename to services/s6-overlay/s6-rc.d/tedge-log-plugin/type diff --git a/services/s6-overlay/s6-rc.d/user/contents.d/c8y-log-plugin-pipeline b/services/s6-overlay/s6-rc.d/user/contents.d/tedge-log-plugin-pipeline similarity index 100% rename from services/s6-overlay/s6-rc.d/user/contents.d/c8y-log-plugin-pipeline rename to services/s6-overlay/s6-rc.d/user/contents.d/tedge-log-plugin-pipeline diff --git a/services/supervisord/conf.d/c8y-log-plugin.conf b/services/supervisord/conf.d/tedge-log-plugin.conf similarity index 62% rename from services/supervisord/conf.d/c8y-log-plugin.conf rename to services/supervisord/conf.d/tedge-log-plugin.conf index 1a854bf..31c5d00 100644 --- a/services/supervisord/conf.d/c8y-log-plugin.conf +++ b/services/supervisord/conf.d/tedge-log-plugin.conf @@ -1,5 +1,5 @@ -[program:c8y-log-plugin] -command=/usr/bin/c8y-log-plugin +[program:tedge-log-plugin] +command=/usr/bin/tedge-log-plugin user=root startsecs=5 autostart=true diff --git a/services/sysvinit-yocto/init.d/c8y-log-plugin b/services/sysvinit-yocto/init.d/tedge-log-plugin similarity index 96% rename from services/sysvinit-yocto/init.d/c8y-log-plugin rename to services/sysvinit-yocto/init.d/tedge-log-plugin index 7674171..9e1b508 100755 --- a/services/sysvinit-yocto/init.d/c8y-log-plugin +++ b/services/sysvinit-yocto/init.d/tedge-log-plugin @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: c8y-log-plugin +# Provides: tedge-log-plugin # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 @@ -10,11 +10,11 @@ ### END INIT INFO dir="/var" -DAEMON="/usr/bin/c8y-log-plugin" +DAEMON="/usr/bin/tedge-log-plugin" DAEMON_USER="root" DAEMON_ARGS="" -name="c8y-log-plugin" +name="tedge-log-plugin" PIDFILE=/run/lock/$name.lock stdout_log="/var/log/$name.log" stderr_log="/var/log/$name.err" @@ -61,7 +61,7 @@ is_running() { # shellcheck disable=SC2009 # Use ps/grep fallback as busybox does not support the "ps -p" option if command -V pidof >/dev/null 2>&1; then - pidof c8y-log-plugin >/dev/null + pidof tedge-log-plugin >/dev/null else PROCESSES=$(ps -x || ps) [ -f "$PIDFILE" ] && (echo "$PROCESSES" | grep "^[[:blank:]]*$(get_pid)" >/dev/null 2>&1) diff --git a/services/sysvinit/init.d/c8y-log-plugin b/services/sysvinit/init.d/tedge-log-plugin similarity index 75% rename from services/sysvinit/init.d/c8y-log-plugin rename to services/sysvinit/init.d/tedge-log-plugin index e55059f..a1c4bf4 100755 --- a/services/sysvinit/init.d/c8y-log-plugin +++ b/services/sysvinit/init.d/tedge-log-plugin @@ -1,9 +1,9 @@ #!/bin/sh -#/etc/init.d/c8y-log-plugin: Thin-edge logfile retriever for Cumulocity +#/etc/init.d/tedge-log-plugin: thin-edge.io log file retriever ### BEGIN INIT INFO -# Provides: c8y-log-plugin -# Short-Description: Thin-edge logfile retriever for Cumulocity +# Provides: tedge-log-plugin +# Short-Description: thin-edge.io log file retriever # Required-Start: $all # Required-Stop: $all # Should-Start: @@ -19,24 +19,24 @@ set -e PATH=/bin:/usr/bin:/sbin:/usr/sbin -test -x "/usr/bin/c8y-log-plugin" || exit 0 +test -x "/usr/bin/tedge-log-plugin" || exit 0 # For configuration of the init script use the file -# /etc/default/c8y-log-plugin, do not edit this init script. +# /etc/default/tedge-log-plugin, do not edit this init script. -# Set run_service to 1 to start c8y-log-plugin or 0 to disable it. +# Set run_service to 1 to start tedge-log-plugin or 0 to disable it. run_service=1 DAEMON_ARGS="" DAEMON_USER="root" -LOG_FILE=/var/log/c8y-log-plugin.log +LOG_FILE=/var/log/tedge-log-plugin.log export TEDGE_RUN_LOCK_FILES="false" -[ -e "/etc/default/c8y-log-plugin" ] && . "/etc/default/c8y-log-plugin" +[ -e "/etc/default/tedge-log-plugin" ] && . "/etc/default/tedge-log-plugin" -DAEMON=/usr/bin/c8y-log-plugin -PIDFILE=/run/lock/c8y-log-plugin.lock +DAEMON=/usr/bin/tedge-log-plugin +PIDFILE=/run/lock/tedge-log-plugin.lock STOP_RETRY_SCHEDULE='TERM/30/KILL/1' @@ -75,7 +75,7 @@ fi do_start() { if [ $run_service = 1 ] then - log_begin_msg "Starting c8y-log-plugin daemon..." + log_begin_msg "Starting tedge-log-plugin daemon..." # Create log file with given user so it can write to it (for non-root users) touch "$LOG_FILE" @@ -92,7 +92,7 @@ do_start() { do_stop() { if [ $run_service = 1 ] then - log_begin_msg "Stopping c8y-log-plugin daemon..." + log_begin_msg "Stopping tedge-log-plugin daemon..." if start-stop-daemon --stop --quiet --oknodo --retry "$STOP_RETRY_SCHEDULE" --pidfile "${PIDFILE}" --user "${DAEMON_USER}"; then log_end_msg 0 @@ -119,7 +119,7 @@ case "$1" in try-restart|force-reload) if [ $run_service = 0 ]; then exit 0; fi - log_daemon_msg "Restarting c8y-log-plugin" + log_daemon_msg "Restarting tedge-log-plugin" # force-reload is the same as reload or try-restart according # to its definition, the reload is not implemented here, so # force-reload is the alias of try-restart here, but it should @@ -134,7 +134,7 @@ case "$1" in ;; *) - echo "Usage: /etc/init.d/c8y-log-plugin {start|stop|status|restart|try-restart|force-reload}" >&2 + echo "Usage: /etc/init.d/tedge-log-plugin {start|stop|status|restart|try-restart|force-reload}" >&2 exit 1 esac diff --git a/services/template-input/tedge-log-plugin b/services/template-input/tedge-log-plugin index a4eb65f..8f1cfe6 100644 --- a/services/template-input/tedge-log-plugin +++ b/services/template-input/tedge-log-plugin @@ -1,5 +1,5 @@ -NAME=c8y-log-plugin -COMMAND=/usr/bin/c8y-log-plugin +NAME=tedge-log-plugin +COMMAND=/usr/bin/tedge-log-plugin #COMMAND_ARGS= COMMAND_USER=root -DESCRIPTION="Thin-edge logfile retriever for Cumulocity" \ No newline at end of file +DESCRIPTION="thin-edge.io log file retriever" \ No newline at end of file