diff --git a/services/openrc/conf.d/tedge-configuration-plugin b/services/openrc/conf.d/tedge-configuration-plugin deleted file mode 100644 index 7ac6821..0000000 --- a/services/openrc/conf.d/tedge-configuration-plugin +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration file for /etc/init.d/tedge-configuration-plugin - -# Additional arguments to pass to /usr/bin/tedge-configuration-plugin. -#command_args= - -# Overwrite user -#command_user= - -# Comment out if you don't want to use the supervisor -supervisor="supervise-daemon" -respawn_delay=5 diff --git a/services/openrc/conf.d/tedge-log-plugin b/services/openrc/conf.d/tedge-log-plugin deleted file mode 100644 index b0dce69..0000000 --- a/services/openrc/conf.d/tedge-log-plugin +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration file for /etc/init.d/tedge-log-plugin - -# Additional arguments to pass to /usr/bin/tedge-log-plugin. -#command_args= - -# Overwrite user -#command_user= - -# Comment out if you don't want to use the supervisor -supervisor="supervise-daemon" -respawn_delay=5 diff --git a/services/openrc/init.d/tedge-configuration-plugin b/services/openrc/init.d/tedge-configuration-plugin deleted file mode 100755 index 09ae77a..0000000 --- a/services/openrc/init.d/tedge-configuration-plugin +++ /dev/null @@ -1,20 +0,0 @@ -#!/sbin/openrc-run -description="Thin-edge device configuration management" -command="/usr/bin/tedge-configuration-plugin" -: ${command_args=} -: ${command_user=root} -pidfile="/run/lock/${RC_SVCNAME}.lock" -TEDGE_LOGFILE="${TEDGE_LOGFILE:-/var/log/${RC_SVCNAME}.log}" -supervise_daemon_args=" --env TEDGE_RUN_LOCK_FILES=false" -error_log="${TEDGE_LOGFILE}" - -start_pre() -{ - if [ -n "root" ]; then - checkpath --file --owner "root" "$TEDGE_LOGFILE" - fi -} - -depend() { - after net -} diff --git a/services/openrc/init.d/tedge-log-plugin b/services/openrc/init.d/tedge-log-plugin deleted file mode 100755 index 283749d..0000000 --- a/services/openrc/init.d/tedge-log-plugin +++ /dev/null @@ -1,20 +0,0 @@ -#!/sbin/openrc-run -description="thin-edge.io log file retriever" -command="/usr/bin/tedge-log-plugin" -: ${command_args=} -: ${command_user=root} -pidfile="/run/lock/${RC_SVCNAME}.lock" -TEDGE_LOGFILE="${TEDGE_LOGFILE:-/var/log/${RC_SVCNAME}.log}" -supervise_daemon_args=" --env TEDGE_RUN_LOCK_FILES=false" -error_log="${TEDGE_LOGFILE}" - -start_pre() -{ - if [ -n "root" ]; then - checkpath --file --owner "root" "$TEDGE_LOGFILE" - fi -} - -depend() { - after net -} diff --git a/services/runit/runsvdir/tedge-configuration-plugin/run b/services/runit/runsvdir/tedge-configuration-plugin/run deleted file mode 100755 index 4c94885..0000000 --- a/services/runit/runsvdir/tedge-configuration-plugin/run +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -e -touch "/var/log/tedge-configuration-plugin.log" -DAEMON_USER="root" -LOG_FILE="/var/log/tedge-configuration-plugin.log" -PIDFILE="/run/lock/tedge-configuration-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-configuration-plugin.log" -fi -exec chpst -u "$DAEMON_USER" "/usr/bin/tedge-configuration-plugin" >> "$LOG_FILE" 2>&1 diff --git a/services/runit/runsvdir/tedge-log-plugin/run b/services/runit/runsvdir/tedge-log-plugin/run deleted file mode 100755 index 7bb0c65..0000000 --- a/services/runit/runsvdir/tedge-log-plugin/run +++ /dev/null @@ -1,15 +0,0 @@ -#!/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/tedge-configuration-plugin-log/consumer-for b/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/consumer-for deleted file mode 100644 index 9e119f7..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/consumer-for +++ /dev/null @@ -1 +0,0 @@ -tedge-configuration-plugin \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/pipeline-name b/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/pipeline-name deleted file mode 100644 index e01a43a..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/pipeline-name +++ /dev/null @@ -1 +0,0 @@ -tedge-configuration-plugin-pipeline \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/run b/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/run deleted file mode 100755 index ba47bcc..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -sed 's/^/\x1b[34mtedge-configuration-plugin |\x1b[0m /' --unbuffered \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/type b/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/type deleted file mode 100644 index 1780f9f..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin-log/type +++ /dev/null @@ -1 +0,0 @@ -longrun \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/dependencies.d/base b/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/dependencies.d/base deleted file mode 100644 index e69de29..0000000 diff --git a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/producer-for b/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/producer-for deleted file mode 100644 index 2b68d55..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/producer-for +++ /dev/null @@ -1 +0,0 @@ -tedge-configuration-plugin-log \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/run b/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/run deleted file mode 100755 index dcab8d0..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/run +++ /dev/null @@ -1,10 +0,0 @@ -#!/command/with-contenv sh -if [ "${SERVICE_TEDGE_CONFIGURATION_PLUGIN:-1}" -eq 0 ]; then - # Disable service and don't start again - # https://github.com/just-containers/s6-overlay/issues/394 - s6-svc -O . - exit 0 -fi - -exec 2>&1 -exec /usr/bin/tedge-configuration-plugin diff --git a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/type b/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/type deleted file mode 100644 index 1780f9f..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-configuration-plugin/type +++ /dev/null @@ -1 +0,0 @@ -longrun \ 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 deleted file mode 100644 index 4be0923..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/consumer-for +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 27ef4d4..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/pipeline-name +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100755 index 4fb792e..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/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/tedge-log-plugin-log/type b/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/type deleted file mode 100644 index 1780f9f..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-log-plugin-log/type +++ /dev/null @@ -1 +0,0 @@ -longrun \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-log-plugin/dependencies.d/base b/services/s6-overlay/s6-rc.d/tedge-log-plugin/dependencies.d/base deleted file mode 100644 index e69de29..0000000 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 deleted file mode 100644 index 9d0270d..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-log-plugin/producer-for +++ /dev/null @@ -1 +0,0 @@ -tedge-log-plugin-log \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/tedge-log-plugin/run b/services/s6-overlay/s6-rc.d/tedge-log-plugin/run deleted file mode 100755 index 47474b6..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-log-plugin/run +++ /dev/null @@ -1,10 +0,0 @@ -#!/command/with-contenv sh -if [ "${SERVICE_TEDGE_LOG_PLUGIN:-1}" -eq 0 ]; then - # Disable service and don't start again - # https://github.com/just-containers/s6-overlay/issues/394 - s6-svc -O . - exit 0 -fi - -exec 2>&1 -exec /usr/bin/tedge-log-plugin diff --git a/services/s6-overlay/s6-rc.d/tedge-log-plugin/type b/services/s6-overlay/s6-rc.d/tedge-log-plugin/type deleted file mode 100644 index 1780f9f..0000000 --- a/services/s6-overlay/s6-rc.d/tedge-log-plugin/type +++ /dev/null @@ -1 +0,0 @@ -longrun \ No newline at end of file diff --git a/services/s6-overlay/s6-rc.d/user/contents.d/tedge-configuration-plugin-pipeline b/services/s6-overlay/s6-rc.d/user/contents.d/tedge-configuration-plugin-pipeline deleted file mode 100644 index e69de29..0000000 diff --git a/services/s6-overlay/s6-rc.d/user/contents.d/tedge-log-plugin-pipeline b/services/s6-overlay/s6-rc.d/user/contents.d/tedge-log-plugin-pipeline deleted file mode 100644 index e69de29..0000000 diff --git a/services/supervisord/conf.d/tedge-configuration-plugin.conf b/services/supervisord/conf.d/tedge-configuration-plugin.conf deleted file mode 100644 index 687474d..0000000 --- a/services/supervisord/conf.d/tedge-configuration-plugin.conf +++ /dev/null @@ -1,7 +0,0 @@ -[program:tedge-configuration-plugin] -command=/usr/bin/tedge-configuration-plugin -user=root -startsecs=5 -autostart=true -redirect_stderr=true -stdout_logfile=/var/log/%(program_name)s.log diff --git a/services/supervisord/conf.d/tedge-log-plugin.conf b/services/supervisord/conf.d/tedge-log-plugin.conf deleted file mode 100644 index 31c5d00..0000000 --- a/services/supervisord/conf.d/tedge-log-plugin.conf +++ /dev/null @@ -1,7 +0,0 @@ -[program:tedge-log-plugin] -command=/usr/bin/tedge-log-plugin -user=root -startsecs=5 -autostart=true -redirect_stderr=true -stdout_logfile=/var/log/%(program_name)s.log diff --git a/services/systemd/system/tedge-configuration-plugin.service b/services/systemd/system/tedge-configuration-plugin.service deleted file mode 100755 index 6a95750..0000000 --- a/services/systemd/system/tedge-configuration-plugin.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Thin-edge device configuration management -After=syslog.target network.target mosquitto.service - -[Service] -User=root -RuntimeDirectory=tedge-configuration-plugin -ExecStart=/usr/bin/tedge-configuration-plugin -Restart=on-failure -RestartPreventExitStatus=255 -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/services/systemd/system/tedge-log-plugin.service b/services/systemd/system/tedge-log-plugin.service deleted file mode 100755 index 53d9bdb..0000000 --- a/services/systemd/system/tedge-log-plugin.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=thin-edge.io log file retriever -After=syslog.target network.target mosquitto.service - -[Service] -User=root -RuntimeDirectory=tedge-log-plugin -ExecStart=/usr/bin/tedge-log-plugin -Restart=on-failure -RestartPreventExitStatus=255 -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/services/sysvinit-yocto/init.d/tedge-configuration-plugin b/services/sysvinit-yocto/init.d/tedge-configuration-plugin deleted file mode 100755 index c1ae234..0000000 --- a/services/sysvinit-yocto/init.d/tedge-configuration-plugin +++ /dev/null @@ -1,159 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: tedge-configuration-plugin -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Thin-edge device configuration management -# Description: Thin-edge device configuration management -### END INIT INFO - -dir="/var" -DAEMON="/usr/bin/tedge-configuration-plugin" -DAEMON_USER="root" -DAEMON_ARGS="" - -name="tedge-configuration-plugin" -PIDFILE=/run/lock/$name.lock -stdout_log="/var/log/$name.log" -stderr_log="/var/log/$name.err" - -user_exists() { - if command -V getent > /dev/null 2>&1; then - getent passwd "$1" >/dev/null - else - # Fallback to plain grep, as busybox does not have getent - grep -q "^${1}:" /etc/passwd - fi -} - -# Check if sudo or su is installed, otherwise don't use it -SUDO="" -if [ -n "$DAEMON_USER" ]; then - if user_exists "$DAEMON_USER"; then - if command -V sudo >/dev/null 2>&1; then - SUDO="sudo" - if [ -n "$DAEMON_USER" ] && user_exists "$DAEMON_USER"; then - SUDO="sudo -u $DAEMON_USER" - fi - elif command -V runuser >/dev/null 2>&1; then - SUDO="runuser" - if [ -n "$DAEMON_USER" ] && user_exists "$DAEMON_USER"; then - SUDO="runuser -u $DAEMON_USER --" - fi - elif command -V su >/dev/null 2>&1; then - # Note: using su requires a user which can login - # su -s /bin/sh -c '$DAEMON $DAEMON_AGS' $DAEMON_USER - SUDO="su" - if [ -n "$DAEMON_USER" ] && user_exists "$DAEMON_USER"; then - SUDO="su - $DAEMON_USER" - fi - fi - else - echo "WARNING: Daemon user does not exist, so starting the service as current user. DAEMON_USER=$DAEMON_USER" - fi -fi - -get_pid() { cat "$PIDFILE"; } - -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 tedge-configuration-plugin >/dev/null - else - PROCESSES=$(ps -x || ps) - [ -f "$PIDFILE" ] && (echo "$PROCESSES" | grep "^[[:blank:]]*$(get_pid)" >/dev/null 2>&1) - fi -} - -case "$1" in - start) - if is_running; then - echo "Already started" - else - echo "Starting $name (using '$SUDO $DAEMON $DAEMON_ARGS')" - cd "$dir" || (echo "Failed changing directory"; exit 1) - $SUDO $DAEMON $DAEMON_ARGS >> "$stdout_log" 2>> "$stderr_log" & - # TODO: is it ok to let the process create the pidfile itself? - # echo $! > "$PIDFILE" - - i=10 - printf "Waiting for %s.." "$name" - while [ $i -gt 0 ]; do - if is_running; then - break - fi - printf "." - i=$((i-1)) - sleep 1 - done - - if ! is_running; then - echo "Unable to start, see $stdout_log and $stderr_log" - exit 1 - else - echo "started" - fi - fi - ;; - stop) - if is_running; then - printf "Stopping (pid=%s) %s.." "$(get_pid)" "$name" - kill "$(get_pid)" - i=30 - while [ $i -gt 0 ]; do - if ! is_running; then - break - fi - printf "." - i=$((i-1)) - sleep 1 - done - echo - - if is_running; then - echo "Not stopped; may still be shutting down or shutdown may have failed" - exit 1 - else - echo "stopped" - if [ -f "$PIDFILE" ]; then - rm -f "$PIDFILE" - fi - fi - else - echo "Not running" - fi - ;; - # reload) - # if is_running; then - # echo "Reloading configuration" - # kill -HUP "$(get_pid)" - # else - # echo "Not running" - # fi - # ;; - restart) - "$0" stop - if is_running; then - echo "Unable to stop, will not attempt to start" - exit 1 - fi - "$0" start - ;; - status) - if is_running; then - echo "Running" - else - echo "Stopped" - exit 1 - fi - ;; - *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; -esac - -exit 0 \ No newline at end of file diff --git a/services/sysvinit-yocto/init.d/tedge-log-plugin b/services/sysvinit-yocto/init.d/tedge-log-plugin deleted file mode 100755 index 0c3c526..0000000 --- a/services/sysvinit-yocto/init.d/tedge-log-plugin +++ /dev/null @@ -1,159 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: tedge-log-plugin -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: thin-edge.io log file retriever -# Description: thin-edge.io log file retriever -### END INIT INFO - -dir="/var" -DAEMON="/usr/bin/tedge-log-plugin" -DAEMON_USER="root" -DAEMON_ARGS="" - -name="tedge-log-plugin" -PIDFILE=/run/lock/$name.lock -stdout_log="/var/log/$name.log" -stderr_log="/var/log/$name.err" - -user_exists() { - if command -V getent > /dev/null 2>&1; then - getent passwd "$1" >/dev/null - else - # Fallback to plain grep, as busybox does not have getent - grep -q "^${1}:" /etc/passwd - fi -} - -# Check if sudo or su is installed, otherwise don't use it -SUDO="" -if [ -n "$DAEMON_USER" ]; then - if user_exists "$DAEMON_USER"; then - if command -V sudo >/dev/null 2>&1; then - SUDO="sudo" - if [ -n "$DAEMON_USER" ] && user_exists "$DAEMON_USER"; then - SUDO="sudo -u $DAEMON_USER" - fi - elif command -V runuser >/dev/null 2>&1; then - SUDO="runuser" - if [ -n "$DAEMON_USER" ] && user_exists "$DAEMON_USER"; then - SUDO="runuser -u $DAEMON_USER --" - fi - elif command -V su >/dev/null 2>&1; then - # Note: using su requires a user which can login - # su -s /bin/sh -c '$DAEMON $DAEMON_AGS' $DAEMON_USER - SUDO="su" - if [ -n "$DAEMON_USER" ] && user_exists "$DAEMON_USER"; then - SUDO="su - $DAEMON_USER" - fi - fi - else - echo "WARNING: Daemon user does not exist, so starting the service as current user. DAEMON_USER=$DAEMON_USER" - fi -fi - -get_pid() { cat "$PIDFILE"; } - -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 tedge-log-plugin >/dev/null - else - PROCESSES=$(ps -x || ps) - [ -f "$PIDFILE" ] && (echo "$PROCESSES" | grep "^[[:blank:]]*$(get_pid)" >/dev/null 2>&1) - fi -} - -case "$1" in - start) - if is_running; then - echo "Already started" - else - echo "Starting $name (using '$SUDO $DAEMON $DAEMON_ARGS')" - cd "$dir" || (echo "Failed changing directory"; exit 1) - $SUDO $DAEMON $DAEMON_ARGS >> "$stdout_log" 2>> "$stderr_log" & - # TODO: is it ok to let the process create the pidfile itself? - # echo $! > "$PIDFILE" - - i=10 - printf "Waiting for %s.." "$name" - while [ $i -gt 0 ]; do - if is_running; then - break - fi - printf "." - i=$((i-1)) - sleep 1 - done - - if ! is_running; then - echo "Unable to start, see $stdout_log and $stderr_log" - exit 1 - else - echo "started" - fi - fi - ;; - stop) - if is_running; then - printf "Stopping (pid=%s) %s.." "$(get_pid)" "$name" - kill "$(get_pid)" - i=30 - while [ $i -gt 0 ]; do - if ! is_running; then - break - fi - printf "." - i=$((i-1)) - sleep 1 - done - echo - - if is_running; then - echo "Not stopped; may still be shutting down or shutdown may have failed" - exit 1 - else - echo "stopped" - if [ -f "$PIDFILE" ]; then - rm -f "$PIDFILE" - fi - fi - else - echo "Not running" - fi - ;; - # reload) - # if is_running; then - # echo "Reloading configuration" - # kill -HUP "$(get_pid)" - # else - # echo "Not running" - # fi - # ;; - restart) - "$0" stop - if is_running; then - echo "Unable to stop, will not attempt to start" - exit 1 - fi - "$0" start - ;; - status) - if is_running; then - echo "Running" - else - echo "Stopped" - exit 1 - fi - ;; - *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; -esac - -exit 0 \ No newline at end of file diff --git a/services/sysvinit/init.d/tedge-configuration-plugin b/services/sysvinit/init.d/tedge-configuration-plugin deleted file mode 100755 index 92b9a18..0000000 --- a/services/sysvinit/init.d/tedge-configuration-plugin +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/sh -#/etc/init.d/tedge-configuration-plugin: Thin-edge device configuration management - -### BEGIN INIT INFO -# Provides: tedge-configuration-plugin -# Short-Description: Thin-edge device configuration management -# Required-Start: $all -# Required-Stop: $all -# Should-Start: -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -### END INIT INFO - -# shellcheck disable=SC1090 -# shellcheck disable=SC1091 - -set -e - -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -test -x "/usr/bin/tedge-configuration-plugin" || exit 0 - -# For configuration of the init script use the file -# /etc/default/tedge-configuration-plugin, do not edit this init script. - -# Set run_service to 1 to start tedge-configuration-plugin or 0 to disable it. -run_service=1 - -DAEMON_ARGS="" -DAEMON_USER="root" -LOG_FILE=/var/log/tedge-configuration-plugin.log - -export TEDGE_RUN_LOCK_FILES="false" - -[ -e "/etc/default/tedge-configuration-plugin" ] && . "/etc/default/tedge-configuration-plugin" - -DAEMON=/usr/bin/tedge-configuration-plugin -PIDFILE=/run/lock/tedge-configuration-plugin.lock - -STOP_RETRY_SCHEDULE='TERM/30/KILL/1' - -# Mock Debian helper functions when not being run on a debian based OS -log_begin_msg() { - printf "%s" "$*" -} - -log_end_msg() { - if [ "$1" = "0" ]; then - echo 'done' - else - echo 'error' - fi -} - -log_daemon_msg() { - echo "$*" -} - -log_progress_msg() { - echo "$*" -} - -# TODO: Can the imports be excluded if the mocked functions are used above? -if [ -f /lib/lsb/init-functions ]; then - # Debian based systems including WSL (ubuntu) - . /lib/lsb/init-functions -fi - -if [ -f /etc/init.d/functions ]; then - # YOCTO - . /etc/init.d/functions -fi - -do_start() { - if [ $run_service = 1 ] - then - log_begin_msg "Starting tedge-configuration-plugin daemon..." - - # Create log file with given user so it can write to it (for non-root users) - touch "$LOG_FILE" - if [ -n "$DAEMON_USER" ]; then - chown "$DAEMON_USER" "$LOG_FILE" - fi - - start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile "$PIDFILE" --chuid "${DAEMON_USER}" --user "${DAEMON_USER}" \ - --startas /bin/sh -- -c "exec $DAEMON $DAEMON_ARGS >> '$LOG_FILE' 2>&1" - log_end_msg $? - fi -} - -do_stop() { - if [ $run_service = 1 ] - then - log_begin_msg "Stopping tedge-configuration-plugin daemon..." - - if start-stop-daemon --stop --quiet --oknodo --retry "$STOP_RETRY_SCHEDULE" --pidfile "${PIDFILE}" --user "${DAEMON_USER}"; then - log_end_msg 0 - rm -f "${PIDFILE}" - else - log_end_msg 1 - fi - fi -} - -case "$1" in - start) - do_start - ;; - - stop) - do_stop - ;; - - restart) - do_stop - do_start - ;; - - try-restart|force-reload) - if [ $run_service = 0 ]; then exit 0; fi - log_daemon_msg "Restarting tedge-configuration-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 - # be the alias of reload if reload is implemented. - # - # Only start the service when do_stop succeeds - do_stop && do_start - ;; - - status) - status "$DAEMON" - ;; - - *) - echo "Usage: /etc/init.d/tedge-configuration-plugin {start|stop|status|restart|try-restart|force-reload}" >&2 - exit 1 - -esac - -exit 0 \ No newline at end of file diff --git a/services/sysvinit/init.d/tedge-log-plugin b/services/sysvinit/init.d/tedge-log-plugin deleted file mode 100755 index a1c4bf4..0000000 --- a/services/sysvinit/init.d/tedge-log-plugin +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/sh -#/etc/init.d/tedge-log-plugin: thin-edge.io log file retriever - -### BEGIN INIT INFO -# Provides: tedge-log-plugin -# Short-Description: thin-edge.io log file retriever -# Required-Start: $all -# Required-Stop: $all -# Should-Start: -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -### END INIT INFO - -# shellcheck disable=SC1090 -# shellcheck disable=SC1091 - -set -e - -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -test -x "/usr/bin/tedge-log-plugin" || exit 0 - -# For configuration of the init script use the file -# /etc/default/tedge-log-plugin, do not edit this init script. - -# 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/tedge-log-plugin.log - -export TEDGE_RUN_LOCK_FILES="false" - -[ -e "/etc/default/tedge-log-plugin" ] && . "/etc/default/tedge-log-plugin" - -DAEMON=/usr/bin/tedge-log-plugin -PIDFILE=/run/lock/tedge-log-plugin.lock - -STOP_RETRY_SCHEDULE='TERM/30/KILL/1' - -# Mock Debian helper functions when not being run on a debian based OS -log_begin_msg() { - printf "%s" "$*" -} - -log_end_msg() { - if [ "$1" = "0" ]; then - echo 'done' - else - echo 'error' - fi -} - -log_daemon_msg() { - echo "$*" -} - -log_progress_msg() { - echo "$*" -} - -# TODO: Can the imports be excluded if the mocked functions are used above? -if [ -f /lib/lsb/init-functions ]; then - # Debian based systems including WSL (ubuntu) - . /lib/lsb/init-functions -fi - -if [ -f /etc/init.d/functions ]; then - # YOCTO - . /etc/init.d/functions -fi - -do_start() { - if [ $run_service = 1 ] - then - 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" - if [ -n "$DAEMON_USER" ]; then - chown "$DAEMON_USER" "$LOG_FILE" - fi - - start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile "$PIDFILE" --chuid "${DAEMON_USER}" --user "${DAEMON_USER}" \ - --startas /bin/sh -- -c "exec $DAEMON $DAEMON_ARGS >> '$LOG_FILE' 2>&1" - log_end_msg $? - fi -} - -do_stop() { - if [ $run_service = 1 ] - then - 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 - rm -f "${PIDFILE}" - else - log_end_msg 1 - fi - fi -} - -case "$1" in - start) - do_start - ;; - - stop) - do_stop - ;; - - restart) - do_stop - do_start - ;; - - try-restart|force-reload) - if [ $run_service = 0 ]; then exit 0; fi - 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 - # be the alias of reload if reload is implemented. - # - # Only start the service when do_stop succeeds - do_stop && do_start - ;; - - status) - status "$DAEMON" - ;; - - *) - echo "Usage: /etc/init.d/tedge-log-plugin {start|stop|status|restart|try-restart|force-reload}" >&2 - exit 1 - -esac - -exit 0 \ No newline at end of file diff --git a/services/template-input/tedge-configuration-plugin b/services/template-input/tedge-configuration-plugin deleted file mode 100644 index 4a0288f..0000000 --- a/services/template-input/tedge-configuration-plugin +++ /dev/null @@ -1,6 +0,0 @@ -NAME=tedge-configuration-plugin -COMMAND=/usr/bin/tedge-configuration-plugin -#COMMAND_ARGS= -COMMAND_USER=root -ENV_ENABLE_SERVICE=SERVICE_TEDGE_CONFIGURATION_PLUGIN -DESCRIPTION="Thin-edge device configuration management" \ No newline at end of file diff --git a/services/template-input/tedge-log-plugin b/services/template-input/tedge-log-plugin deleted file mode 100644 index 8571efc..0000000 --- a/services/template-input/tedge-log-plugin +++ /dev/null @@ -1,6 +0,0 @@ -NAME=tedge-log-plugin -COMMAND=/usr/bin/tedge-log-plugin -#COMMAND_ARGS= -COMMAND_USER=root -ENV_ENABLE_SERVICE=SERVICE_TEDGE_LOG_PLUGIN -DESCRIPTION="thin-edge.io log file retriever" \ No newline at end of file