Remove all init systems that use some variations of /etc/init.d

This commit is contained in:
Sandro Jäckel 2023-02-08 14:02:02 +01:00
parent c5a956e386
commit 8f7ddce2ec
No known key found for this signature in database
GPG key ID: B1763F8651144063
9 changed files with 1 additions and 427 deletions

View file

@ -13,12 +13,6 @@ EXTRA_DIST = \
sample-etc_dhclient-exit-hooks \
sample-etc_dhcpc_dhcpcd-eth0.exe \
sample-etc_ppp_ip-up.local \
sample-etc_rc.d_ddclient.freebsd \
sample-etc_rc.d_init.d_ddclient \
sample-etc_rc.d_init.d_ddclient.alpine \
sample-etc_rc.d_init.d_ddclient.lsb \
sample-etc_rc.d_init.d_ddclient.redhat \
sample-etc_rc.d_init.d_ddclient.ubuntu \
sample-etc_systemd.service \
sample-get-ip-from-fritzbox
CLEANFILES =

View file

@ -116,82 +116,6 @@ start the first time by hand
systemctl start ddclient.service
#### Redhat style rc files and daemon-mode
cp sample-etc_rc.d_init.d_ddclient /etc/rc.d/init.d/ddclient
enable automatic startup when booting. also check your distribution
/sbin/chkconfig --add ddclient
start the first time by hand
/etc/rc.d/init.d/ddclient start
#### Alpine style rc files and daemon-mode
cp sample-etc_rc.d_init.d_ddclient.alpine /etc/init.d/ddclient
enable automatic startup when booting
rc-update add ddclient
make sure you have perl installed
apk add perl
start the first time by hand
rc-service ddclient start
#### Ubuntu style rc files and daemon-mode
cp sample-etc_rc.d_init.d_ddclient.ubuntu /etc/init.d/ddclient
enable automatic startup when booting
update-rc.d ddclient defaults
make sure you have perl and the required modules installed
apt-get install perl libdata-validate-ip-perl libio-socket-ssl-perl
if you plan to use cloudflare or feedns you need the perl json module
apt-get install libjson-pp-perl
for IPv6 you also need to instal the perl io-socket-inet6 module
apt install libio-socket-inet6-perl
start the first time by hand
service ddclient start
#### FreeBSD style rc files and daemon mode
mkdir -p /usr/local/etc/rc.d
cp sample-etc_rc.d_ddclient.freebsd /usr/local/etc/rc.d/ddclient
enable automatic startup when booting
sysrc ddclient_enable=YES
make sure you have perl and the required modules installed
pkg install perl5 p5-Data-Validate-IP p5-IO-Socket-SSL
if you plan to use cloudflare or feedns you need the perl json module
pkg install p5-JSON-PP
start the service manually for the first time
service ddclient start
If you are not using daemon-mode, configure cron and dhcp or ppp as described below.
## TROUBLESHOOTING
1. enable debugging and verbose messages: ``$ ddclient -daemon=0 -debug -verbose -noquiet``
@ -251,7 +175,7 @@ not become stale.
cp sample-etc_cron.d_ddclient /etc/cron.d/ddclient
vi /etc/cron.d/ddclient
## USING DDCLIENT WITH `dhcpcd-1.3.17`
## USING DDCLIENT WITH `dhcpcd`
If you are using dhcpcd-1.3.17 or thereabouts, you can easily update
your DynDNS entry automatically every time your lease is obtained

View file

@ -1,13 +0,0 @@
Since 3.7.0, ddclient support ssl-updates
To use ssl, put "ssl=yes" in your configuration and make sure
you have IO::Socket::SSL.
On debian, you need libio-socket-ssl-perl to have IO::Socket::SSL
On alpine, you need perl-io-socket-ssl to have IO::Socket::SSL
ssl support is tested on folowing dynamic dns providers:
- dyndns.com
- freemyip.com
- DNS Made Easy
- dondominio.com

View file

@ -1,31 +0,0 @@
#!/bin/sh
# PROVIDE: ddclient
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# ddclient_enable (bool): Set to NO by default.
# Set it to YES to enable ddclient.
. /etc/rc.subr
name=ddclient
rcvar=ddclient_enable
ddclient_conf="/etc/ddclient/ddclient.conf"
command="/usr/local/sbin/${name}"
load_rc_config $name
delay=$(grep -v '^\s*#' "${ddclient_conf}" | grep -i -m 1 "daemon" | awk -F '=' '{print $2}')
if [ -z "${delay}" ]
then
ddclient_flags="-daemon 300"
else
ddclient_flags=""
fi
run_rc_command "$1"

View file

@ -1,100 +0,0 @@
#!/bin/bash
#
# ddclient This shell script takes care of starting and stopping
# ddclient.
#
# chkconfig: 2345 65 35
# description: ddclient provides support for updating dynamic DNS services.
CONF=/etc/ddclient/ddclient.conf
program=ddclient
[ -f $CONF ] || exit 0
system=unknown
if [ -f /etc/fedora-release ]; then
system=fedora
elif [ -f /etc/redhat-release ]; then
system=redhat
elif [ -f /etc/debian_version ]; then
system=debian
fi
PID=''
if [ "$system" = "fedora" ] || [ "$system" = "redhat" ]; then
. /etc/init.d/functions
PID=`pidofproc $program`
else
PID=`ps -aef | grep "$program - sleep" | grep -v grep | awk '{print $2}'`
fi
PATH=/usr/bin:/usr/local/bin:${PATH}
export PATH
# See how we were called.
case "$1" in
start)
# See if daemon=value is specified in the config file.
# Assumptions:
# * there are no quoted "#" characters before "daemon="
# (if there is a "#" it starts a comment)
# * "daemon=" does not appear in a password or value
# * if the interval value is 0, it is not quoted
INTERVAL=$(sed -e '
s/^\([^#]*[,[:space:]]\)\{0,1\}daemon=\([^,[:space:]]*\).*$/\2/
t quit
d
:quit
q
' "$CONF")
if [ -z "$DELAY" ] || [ "$DELAY" = "0" ]; then
DELAY="-daemon 300"
else
# use the interval specified in the config file
DELAY=''
fi
echo -n "Starting ddclient: "
if [ "$system" = "fedora" ] || [ "$system" = "redhat" ]; then
daemon $program $DELAY
else
ddclient $DELAY
fi
echo
;;
stop)
# Stop daemon.
echo -n "Shutting down ddclient: "
if [ -n "$PID" ]; then
if [ "$system" = "fedora" ] || [ "$system" = "redhat" ]; then
killproc $program
else
kill $PID
fi
else
echo "ddclient is not running"
fi
echo
;;
restart)
$0 stop
$0 start
;;
status)
if [ "$system" = "fedora" ] || [ "$system" = "redhat" ]; then
status $program
else
if test "$PID"; then
for p in $PID; do
echo "$program (pid $p) is running"
done
else
echo "$program is stopped"
fi
fi
;;
*)
echo "Usage: ddclient {start|stop|restart|status}"
exit 1
esac
exit 0

View file

@ -1,38 +0,0 @@
#!/sbin/openrc-run
description="ddclient Daemon for Alpine"
command="/usr/bin/ddclient"
config_file="/etc/ddclient/ddclient.conf"
command_args=""
pidfile=$(grep -v '^\s*#' "${config_file}" | grep -i -m 1 pid= | awk -F '=' '{print $2}')
delay=$(grep -v '^\s*#' "${config_file}" | grep -i -m 1 "daemon" | awk -F '=' '{print $2}')
if [ -z "${delay}" ]
then
command_args="-daemon 300"
else
command_args=""
fi
depend() {
use logger
need net
after firewall
}
start() {
ebegin "Starting ddclient"
start-stop-daemon --start \
--exec "${command}" \
--pidfile "${pidfile}" \
-- \
${command_args}
eend $?
}
stop() {
ebegin "Stopping ddclient"
start-stop-daemon --stop --exec "${command}" \
--pidfile "${pidfile}"
eend $?
}

View file

@ -1,64 +0,0 @@
#!/bin/sh
#
# ddclient This shell script takes care of starting and stopping
# ddclient.
#
# chkconfig: 2345 65 35
# description: ddclient provides support for updating dynamic DNS services.
#
# Above is for RedHat and now the LSB part
### BEGIN INIT INFO
# Provides: ddclient
# Required-Start: $syslog $remote_fs
# Should-Start: $time ypbind sendmail
# Required-Stop: $syslog $remote_fs
# Should-Stop: $time ypbind sendmail
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: ddclient provides support for updating dynamic DNS services
# Description: ddclient is a Perl client used to update dynamic DNS
# entries for accounts on many dynamic DNS services and
# can be used on many types of firewalls
### END INIT INFO
#
###
[ -f /etc/ddclient/ddclient.conf ] || exit 0
DDCLIENT_BIN=/usr/bin/ddclient
#
# LSB Standard (SuSE,RedHat,...)
#
if [ -f /lib/lsb/init-functions ] ; then
. /lib/lsb/init-functions
fi
# See how we were called.
case "$1" in
start)
echo -n "Starting ddclient "
start_daemon $DDCLIENT_BIN -daemon 300
rc_status -v
;;
stop)
echo -n "Shutting down ddclient "
killproc -TERM `basename $DDCLIENT_BIN`
rc_status -v
;;
restart)
$0 stop
$0 start
rc_status
;;
status)
echo -n "Checking for service ddclient "
checkproc `basename $DDCLIENT_BIN`w
rc_status -v
;;
*)
echo "Usage: ddclient {start|stop|restart|status}"
exit 1
esac
exit 0

View file

@ -1,41 +0,0 @@
#!/bin/sh
#
# ddclient This shell script takes care of starting and stopping
# ddclient.
#
# chkconfig: 2345 65 35
# description: ddclient provides support for updating dynamic DNS services.
[ -f /etc/ddclient/ddclient.conf ] || exit 0
. /etc/rc.d/init.d/functions
# See how we were called.
case "$1" in
start)
# Start daemon.
echo -n "Starting ddclient: "
touch /var/lock/subsys/ddclient
daemon ddclient -daemon 300
echo
;;
stop)
# Stop daemon.
echo -n "Shutting down ddclient: "
killproc ddclient
echo
rm -f /var/lock/subsys/ddclient
;;
restart)
$0 stop
$0 start
;;
status)
status ddclient
;;
*)
echo "Usage: ddclient {start|stop|restart|status}"
exit 1
esac
exit 0

View file

@ -1,57 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: ddclient
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start ddclient daemon at boot time
# Description: Start ddclient that provides support for updating dynamic DNS services. Originally submitted by paolo martinelli, updated by joe passavanti
### END INIT INFO
DDCLIENT=/usr/bin/ddclient
CONF=/etc/ddclient/ddclient.conf
PIDFILE=/var/run/ddclient.pid
test -x $DDCLIENT || exit 0
test -f $CONF || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
if [ ! -f $PIDFILE ]; then
log_begin_msg "Starting ddclient..."
DELAY=`grep -v '^\s*#' $CONF | grep -i -m 1 "daemon" | awk -F '=' '{print $2}'`
if [ -z "$DELAY" ] ; then
DELAY="-daemon 300"
else
DELAY=''
fi
start-stop-daemon -S -q -p $PIDFILE -x $DDCLIENT -- $DELAY
log_end_msg $?
else
log_warning_msg "Service ddclient already running..."
fi
;;
stop)
if [ -f $PIDFILE ] ; then
log_begin_msg "Stopping ddclient..."
start-stop-daemon -K -q -p $PIDFILE
log_end_msg $?
rm -f $PIDFILE
else
log_warning_msg "No ddclient running..."
fi
;;
restart|reload|force-reload)
$0 stop
$0 start
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0