#53 OpenRC Init Script Repackaging
Opened 9 months ago by morris. Modified 7 months ago
morris/abslibre nonsystemd-openrc  into  pull-requests

brltty
Morris Zuss • 9 months ago  
@@ -0,0 +1,25 @@ 

+ # Maintainer: Rafli Akmal <rafliakmaltejakusuma@gmail.com>

+ # Contributor: artoo <artoo@artixlinux.org>

+ # Contributor: Oscar Campos <damnwidget@artixlinux.org>

+ 

+ 

+ pkgname=acpid-openrc

+ pkgver=20220520

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC acpid init script"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('openrc' 'acpid')

+ conflicts=('systemd-sysvcompat')

+ backup=('etc/conf.d/acpid')

+ source=("acpid.confd"

+         "acpid.initd")

+ sha512sums=('518cb397b2aa63b893ead1be08f32fe436d19b72663dee66834cfbc112b003333f0df8b9e4f1ffe64b813783f657d3fe8b9a0c5e992d5665583357e68b266705'

+             '16ba6ef1638d2069d6065b16becbaf79059d59771f3134512380aea1fe3468b50c42d5a664398cd31ee9bb21d7fc4f31b683a3094e26f8d5a202675b5ffad2cb')

+ 

+ package() {

+   install -Dm755 "$srcdir/acpid.initd" "$pkgdir/etc/init.d/acpid"

+   install -Dm644 "$srcdir/acpid.confd" "$pkgdir/etc/conf.d/acpid"

+ }

@@ -0,0 +1,6 @@ 

+ # /etc/conf.d/acpid: config file for /etc/init.d/acpid

+ 

+ # Options to pass to the acpid daemon.

+ # See the acpid(8) man page for more info.

+ 

+ ACPID_ARGS=""

@@ -0,0 +1,22 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2016 Gentoo Foundation

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ extra_started_commands="reload"

+ command="/usr/bin/acpid"

+ command_args="${ACPID_ARGS}"

+ description="Daemon for Advanced Configuration and Power Interface"

+ supervisor="supervise-daemon"

+ command_args_foreground="--foreground"

+ #pidfile="/run/acpid.pid"

+ 

+ depend() {

+ 	need localmount

+ 	use logger

+ }

+ 

+ reload() {

+ 	ebegin "Reloading acpid configuration"

+ 	${supervisor} ${RC_SVCNAME} --signal HUP --pidfile /run/acpid.pid

+ 	eend $?

+ }

@@ -0,0 +1,23 @@ 

+ # Maintainer: artoo <artoo@artixlinux.org>

+ 

+ pkgname=alsa-utils-openrc

+ pkgver=20220520

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC alsa-utils init script"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('openrc' 'alsa-utils')

+ conflicts=('systemd-sysvcompat')

+ backup=('etc/conf.d/alsasound')

+ source=("alsasound.confd"

+         "alsasound.initd")

+ sha512sums=('90c1e974276945f7632dc370a005b58d669b93edbf27116098d4831e69c11c26d9b21e7eacfaf12c50019f8c88dc1f370101e2d905fdde40887fe36bac00d83e'

+             '2c47ce37f426c14566e4c408d3c73df87900f50818f83a90f8e2238c1256b45e0933dd72a03c08e5b636291696c0e9119b1a6cbe5ed6291208b1a38762a67625')

+ 

+ package() {

+   install -Dm755 "${srcdir}"/alsasound.initd "${pkgdir}"/etc/init.d/alsasound

+   install -Dm644 "${srcdir}"/alsasound.confd "${pkgdir}"/etc/conf.d/alsasound

+ }

+ 

@@ -0,0 +1,15 @@ 

+ # RESTORE_ON_START:

+ # Do you want to restore your mixer settings?  If not, your cards will be

+ # muted.

+ # no - Do not restore state

+ # yes - Restore state

+ 

+ RESTORE_ON_START="yes"

+ 

+ # SAVE_ON_STOP:

+ # Do you want to save changes made to your mixer volumes when alsasound

+ # stops? 

+ # no - Do not save state

+ # yes - Save state

+ 

+ SAVE_ON_STOP="yes"

@@ -0,0 +1,87 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2019 Gentoo Authors

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ alsastatedir=/var/lib/alsa

+ alsascrdir=/etc/alsa.d

+ alsahomedir=/run/alsasound

+ 

+ extra_commands="save restore"

+ 

+ depend() {

+ 	need localmount

+ 	after bootmisc modules isapnp coldplug hotplug

+ }

+ 

+ restore() {

+ 	ebegin "Restoring Mixer Levels"

+ 

+ 	checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1

+ 

+ 	if [ ! -r "${alsastatedir}/asound.state" ] ; then

+ 		ewarn "No mixer config in ${alsastatedir}/asound.state, you have to unmute your card!"

+ 		eend 0

+ 		return 0

+ 	fi

+ 

+ 	local cards="$(sed -n -e 's/^ *\([[:digit:]]*\) .*/\1/p' /proc/asound/cards)"

+ 	local CARDNUM

+ 	for cardnum in ${cards}; do

+ 		[ -e /dev/snd/controlC${cardnum} ] || sleep 2

+ 		[ -e /dev/snd/controlC${cardnum} ] || sleep 2

+ 		[ -e /dev/snd/controlC${cardnum} ] || sleep 2

+ 		[ -e /dev/snd/controlC${cardnum} ] || sleep 2

+ 		alsactl -E HOME="${alsahomedir}" -I -f "${alsastatedir}/asound.state" restore ${cardnum} \

+ 			|| ewarn "Errors while restoring defaults, ignoring"

+ 	done

+ 

+ 	for ossfile in "${alsastatedir}"/oss/card*_pcm* ; do

+ 		[ -e "${ossfile}" ] || continue

+ 		# We use cat because I'm not sure if cp works properly on /proc

+ 		local procfile=${ossfile##${alsastatedir}/oss}

+ 		procfile="$(echo "${procfile}" | sed -e 's,_,/,g')"

+ 		if [ -e /proc/asound/"${procfile}"/oss ] ; then

+ 		    cat "${ossfile}" > /proc/asound/"${procfile}"/oss 

+ 		fi

+ 	done

+ 

+ 	eend 0

+ }

+ 

+ save() {

+ 	ebegin "Storing ALSA Mixer Levels"

+ 

+ 	checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1

+ 

+ 	mkdir -p "${alsastatedir}"

+ 	if ! alsactl -E HOME="${alsahomedir}" -f "${alsastatedir}/asound.state" store; then

+ 		eerror "Error saving levels."

+ 		eend 1

+ 		return 1

+ 	fi

+ 

+ 	for ossfile in /proc/asound/card*/pcm*/oss; do

+ 		[ -e "${ossfile}" ] || continue

+ 		local device=${ossfile##/proc/asound/} ; device=${device%%/oss}

+ 		device="$(echo "${device}" | sed -e 's,/,_,g')"

+ 		mkdir -p "${alsastatedir}/oss/"

+ 		cp "${ossfile}" "${alsastatedir}/oss/${device}"

+ 	done

+ 

+ 	eend 0

+ }

+ 

+ start() {

+ 	if [ "${RESTORE_ON_START}" = "yes" ]; then

+ 		restore

+ 	fi

+ 

+ 	return 0

+ }

+ 

+ stop() {

+ 	if [ "${SAVE_ON_STOP}" = "yes" ]; then

+ 		save

+ 	fi

+ 	return 0

+ }

@@ -0,0 +1,37 @@ 

+ # Maintainer: artoo <artoo@artixlinux.org>

+ 

+ pkgname=apache-openrc

+ pkgver=20220520

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC apache init script"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('apache' 'openrc')

+ conflicts=('systemd-sysvcompat')

+ backup=('etc/conf.d/httpd')

+ source=("httpd.initd"

+ 	"httpd.confd")

+ sha512sums=('3fb9e5ed081d921019e3b2287d6e3655cb299c28be653a7a52c15859bdaca12c14c22380e1573426e36d39295b0fb2d5dcdc030fded55ab8f5e88424156ffbd5'

+             'fb28f9b4290e67b1ff650c1929682f41d7cb98b4d4f257a98062b2217b2ede4895818a6e97b90b7e151f9ab22f5e6fdcd08ca74fa66696b6effcb762c86e2f1e')

+ 

+ package() {

+   install -Dm755 "${srcdir}"/httpd.initd "${pkgdir}"/etc/init.d/httpd

+   install -Dm644 "${srcdir}"/httpd.confd "${pkgdir}"/etc/conf.d/httpd

+ 

+   sed -e 's|/usr/sbin/apache2|/usr/bin/apachectl|' \

+       -e 's|/etc/apache2/httpd.conf|/etc/httpd/conf/httpd.conf|' \

+       -e 's/! test -f/test -f/' \

+       -e 's|/usr/lib/apache2|/usr/lib/httpd|' \

+       -e 's|apache2.pid|httpd/httpd.pid|' \

+       -e 's|apache2 >/dev/null|httpd >/dev/null|' \

+       -e 's|/run/apache_ssl_mutex|/run/httpd|' \

+       -i "${pkgdir}/etc/init.d/httpd"

+ 

+   sed -e 's|/etc/apache2/httpd.conf|/etc/httpd/conf/httpd.conf|' \

+       -e 's|/usr/lib/apache2|/usr/lib/httpd|' \

+       -e 's|apache2.pid|httpd/httpd.pid|' \

+       -e 's|apache2|httpd|g' \

+       -i "${pkgdir}/etc/conf.d/httpd"

+ }

@@ -0,0 +1,74 @@ 

+ # /etc/conf.d/httpd: config file for /etc/init.d/httpd

+ 

+ # When you install a module it is easy to activate or deactivate the modules

+ # and other features of apache using the APACHE2_OPTS line. Every module should

+ # install a configuration in /etc/httpd/modules.d. In that file will have an

+ # <IfDefine NNN> directive where NNN is the option to enable that module.

+ #

+ # Here are the options available in the default configuration:

+ #

+ #  AUTH_DIGEST  Enables mod_auth_digest

+ #  AUTHNZ_LDAP  Enables authentication through mod_ldap (available if USE=ldap)

+ #  CACHE        Enables mod_cache

+ #  DAV          Enables mod_dav

+ #  ERRORDOCS    Enables default error documents for many languages.

+ #  INFO         Enables mod_info, a useful module for debugging

+ #  LANGUAGE     Enables content-negotiation based on language and charset.

+ #  LDAP         Enables mod_ldap (available if USE=ldap)

+ #  MANUAL       Enables /manual/ to be the apache manual (available if USE=docs)

+ #  MEM_CACHE    Enables default configuration mod_mem_cache

+ #  PROXY        Enables mod_proxy

+ #  SSL          Enables SSL (available if USE=ssl)

+ #  STATUS       Enabled mod_status, a useful module for statistics

+ #  SUEXEC       Enables running CGI scripts (in USERDIR) through suexec.

+ #  USERDIR      Enables /~username mapping to /home/username/public_html

+ #

+ #

+ # The following two options provide the default virtual host for the HTTP and

+ # HTTPS protocol. YOU NEED TO ENABLE AT LEAST ONE OF THEM, otherwise apache

+ # will not listen for incomming connections on the approriate port.

+ #

+ #  DEFAULT_VHOST      Enables name-based virtual hosts, with the default

+ #                     virtual host being in /var/www/localhost/htdocs

+ #  SSL_DEFAULT_VHOST  Enables default vhost for SSL (you should enable this

+ #                     when you enable SSL)

+ #

+ APACHE2_OPTS="-D DEFAULT_VHOST -D LANGUAGE -D INFO"

+ 

+ # Extended options for advanced uses of Apache ONLY

+ # You don't need to edit these unless you are doing crazy Apache stuff

+ # As not having them set correctly, or feeding in an incorrect configuration

+ # via them will result in Apache failing to start

+ # YOU HAVE BEEN WARNED.

+ 

+ # PID file

+ #PIDFILE=/run/httpd/httpd.pid

+ 

+ # timeout for startup/shutdown checks

+ #TIMEOUT=10

+ 

+ # ServerRoot setting

+ #SERVERROOT=/usr/lib/httpd

+ 

+ # Configuration file location

+ # - If this does NOT start with a '/', then it is treated relative to

+ # $SERVERROOT by Apache

+ #CONFIGFILE=/etc/httpd/conf/httpd.conf

+ 

+ # Location to log startup errors to

+ # They are normally dumped to your terminal.

+ #STARTUPERRORLOG="/var/log/httpd/startuperror.log"

+ 

+ # A command that outputs a formatted text version of the HTML at the URL

+ # of the command line. Designed for lynx, however other programs may work.

+ #LYNX="lynx -dump"

+ 

+ # The URL to your server's mod_status status page.

+ # Required for status and fullstatus

+ #STATUSURL="http://localhost/server-status"

+ 

+ # Method to use when reloading the server

+ # Valid options are 'restart' and 'graceful'

+ # See http://httpd.apache.org/docs/2.2/stopping.html for information on

+ # what they do and how they differ.

+ #RELOAD_TYPE="graceful"

@@ -0,0 +1,181 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2016 Gentoo Foundation

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ extra_commands="configtest modules virtualhosts"

+ extra_started_commands="configdump fullstatus graceful gracefulstop reload"

+ 

+ description_configdump="Dumps the configuration of the runing apache server. Requires server-info to be enabled and www-client/lynx."

+ description_configtest="Run syntax tests for configuration files."

+ description_fullstatus="Gives the full status of the server. Requires lynx and server-status to be enabled."

+ description_graceful="A graceful restart advises the children to exit after the current request and reloads the configuration."

+ description_gracefulstop="A graceful stop advises the children to exit after the current request and stops the server."

+ description_modules="Dump a list of loaded Static and Shared Modules."

+ description_reload="Kills all children and reloads the configuration."

+ description_virtualhosts="Show the settings as parsed from the config file (currently only shows the virtualhost settings)."

+ description_stop="Kills all children and stops the server."

+ 

+ # Apply default values for some conf.d variables.

+ PIDFILE="${PIDFILE:-/run/httpd/httpd.pid}"

+ TIMEOUT=${TIMEOUT:-15}

+ SERVERROOT="${SERVERROOT:-/usr/lib/httpd}"

+ CONFIGFILE="${CONFIGFILE:-/etc/httpd/conf/httpd.conf}"

+ LYNX="${LYNX:-lynx -dump}"

+ STATUSURL="${STATUSURL:-http://localhost/server-status}"

+ RELOAD_TYPE="${RELOAD_TYPE:-graceful}"

+ 

+ # Append the server root and configuration file parameters to the

+ # user's APACHE2_OPTS.

+ APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}"

+ APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"

+ 

+ # The path to the apache2 binary.

+ APACHE2="/usr/bin/apachectl"

+ 

+ depend() {

+ 	need net

+ 	use dns entropy logger mysql netmount postgresql

+ 	after sshd

+ }

+ 

+ configtest() {

+ 	ebegin "Checking ${SVCNAME} configuration"

+ 	checkconfig

+ 	eend $?

+ }

+ 

+ checkconfd() {

+ 	if [ ! -d ${SERVERROOT} ]; then

+ 		eerror "SERVERROOT does not exist: ${SERVERROOT}"

+ 		return 1

+ 	fi

+ }

+ 

+ checkconfig() {

+ 	checkpath --directory /run/httpd

+ 	checkconfd || return 1

+ 

+ 	OUTPUT=$( ${APACHE2} ${APACHE2_OPTS} -t 2>&1 )

+ 	ret=$?

+ 	if [ $ret -ne 0 ]; then

+ 		eerror "${SVCNAME} has detected an error in your setup:"

+ 		printf "%s\n" "${OUTPUT}"

+ 	fi

+ 

+ 	return $ret

+ }

+ 

+ start() {

+ 	checkconfig || return 1

+ 

+ 	if [ -n "${STARTUPERRORLOG}" ] ; then

+ 		# We must make sure that we only append to APACHE2_OPTS

+ 		# in start() and not in stop() or anywhere else that may

+ 		# be executed along with start(), see bug #566726.

+ 		APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}"

+ 	fi

+ 

+ 	ebegin "Starting ${SVCNAME}"

+ 	# Use start stop daemon to apply system limits #347301 

+ 	start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start

+ 

+ 	local i=0 retval=1

+ 	while [ $i -lt ${TIMEOUT} ] ; do

+ 		if [ -e "${PIDFILE}" ] ; then

+ 			retval=0

+ 			break

+ 		fi

+ 		sleep 1 && i=$(expr $i + 1)

+ 	done

+ 

+ 	eend ${retval}

+ }

+ 

+ stop() {

+ 	if [ "${RC_CMD}" = "restart" ]; then

+ 		checkconfig || return 1

+ 	fi

+ 

+ 	PID=$(cat "${PIDFILE}" 2>/dev/null)

+ 	if [ -z "${PID}" ]; then

+ 		einfo "${SVCNAME} not running (no pid file)"

+ 		return 0

+ 	fi

+ 

+ 	ebegin "Stopping ${SVCNAME}"

+ 	${APACHE2} ${APACHE2_OPTS} -k stop

+ 

+ 	local i=0 retval=0

+ 	while ( test -f "${PIDFILE}" || pgrep -P ${PID} httpd >/dev/null ) \

+ 		&& [ $i -lt ${TIMEOUT} ]; do

+ 		sleep 1 && i=$(expr $i + 1)

+ 	done

+ 	[ -e "${PIDFILE}" ] && retval=1

+ 

+ 	eend ${retval}

+ }

+ 

+ reload() {

+ 	checkconfig || return 1

+ 

+ 	if [ "${RELOAD_TYPE}" = "restart" ]; then

+ 		ebegin "Restarting ${SVCNAME}"

+ 		${APACHE2} ${APACHE2_OPTS} -k restart

+ 		eend $?

+ 	elif [ "${RELOAD_TYPE}" = "graceful" ]; then

+ 		ebegin "Gracefully restarting ${SVCNAME}"

+ 		${APACHE2} ${APACHE2_OPTS} -k graceful

+ 		eend $?

+ 	else

+ 		eerror "${RELOAD_TYPE} is not a valid RELOAD_TYPE. Please edit /etc/conf.d/${SVCNAME}"

+ 	fi

+ }

+ 

+ graceful() {

+ 	checkconfig || return 1

+ 	ebegin "Gracefully restarting ${SVCNAME}"

+ 	${APACHE2} ${APACHE2_OPTS} -k graceful

+ 	eend $?

+ }

+ 

+ gracefulstop() {

+ 	checkconfig || return 1

+ 	ebegin "Gracefully stopping ${SVCNAME}"

+ 	${APACHE2} ${APACHE2_OPTS} -k graceful-stop

+ 	eend $?

+ }

+ 

+ modules() {

+ 	checkconfig || return 1

+ 	${APACHE2} ${APACHE2_OPTS} -M 2>&1

+ }

+ 

+ fullstatus() {

+ 	if ! command -v $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then

+ 		eerror "lynx not found! you need to emerge www-client/lynx"

+ 	else

+ 		${LYNX} ${STATUSURL}

+ 	fi

+ }

+ 

+ virtualhosts() {

+ 	checkconfig || return 1

+ 	${APACHE2} ${APACHE2_OPTS} -S

+ }

+ 

+ configdump() {

+ 	INFOURL="${INFOURL:-http://localhost/server-info}"

+ 

+ 	checkconfd || return 1

+ 

+ 	if ! command -v $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then

+ 		eerror "lynx not found! you need to emerge www-client/lynx"

+ 	else

+ 		echo "${APACHE2} started with '${APACHE2_OPTS}'"

+ 		for i in config server list; do

+ 			${LYNX} "${INFOURL}/?${i}" | sed '/Apache Server Information/d;/^[[:space:]]\+[_]\+$/Q'

+ 		done

+ 	fi

+ }

+ 

+ # vim: ts=4 filetype=gentoo-init-d

@@ -0,0 +1,18 @@ 

+ # Maintainer: artoo <artoo@artixlinux.org>

+ 

+ pkgname=apparmor-openrc

+ pkgver=20220520

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC apparmor init script"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('openrc' 'apparmor')

+ conflicts=('systemd-sysvcompat')

+ source=("apparmor.initd")

+ sha512sums=('4912f8ee8f2e0277d85483279bd4a8ee8e25c9a466a080b0c4fe7c778f6215c144712e166d2a46bb05b0f5411ecfd9b5ef57b1141b76df103d3c577bfd9fd315')

+ 

+ package() {

+   install -Dm755 "${srcdir}"/apparmor.initd "${pkgdir}"/etc/init.d/apparmor

+ }

@@ -0,0 +1,91 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2013 Gentoo Foundation

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ description="Load all configured profiles for the AppArmor security module."

+ description_reload="Reload all profiles"

+ 

+ extra_started_commands="reload"

+ 

+ aa_action() {

+ 	local arg=$1

+ 	local return

+ 

+ 	shift

+ 	$*

+ 	return=$?

+ 

+ 	if [ ${return} -eq 0 ]; then

+ 		aa_log_success_msg $arg

+ 	else

+ 		aa_log_failure_msg arg

+ 	fi

+ 

+ 	return $return

+ }

+ 

+ aa_log_action_start() {

+ 	ebegin $1

+ }

+ 

+ aa_log_action_end() {

+ 	eend $1

+ }

+ 

+ aa_log_success_msg() {

+ 	einfo $1

+ }

+ 

+ aa_log_warning_msg() {

+ 	ewarn $1

+ }

+ 

+ aa_log_failure_msg() {

+ 	eerror $1

+ }

+ 

+ aa_log_skipped_msg() {

+ 	einfo $1

+ }

+ 

+ aa_log_daemon_msg() {

+ 	einfo $1

+ }

+ 

+ aa_log_end_msg() {

+ 	eend $1

+ }

+ 

+ . /usr/lib/apparmor/rc.apparmor.functions

+ 

+ start() {

+ 	ebegin "Starting AppArmor"

+ 	eindent

+ 

+ 	if ! is_apparmor_loaded ; then

+ 		load_module

+ 		if [ $? -ne 0 ]; then

+ 			eerror "AppArmor kernel support is not present"

+ 			eend 1

+ 			return 1

+ 		fi

+ 	fi

+ 

+ 	parse_profiles load

+ 

+ 	eoutdent

+ }

+ 

+ stop() {

+ 	ebegin "Stopping AppArmor"

+ 	eindent

+ 	apparmor_stop

+ 	eoutdent

+ }

+ 

+ reload() {

+ 	# todo: split out clean_profiles into its own function upstream

+ 	# so we can do parse_profiles reload && clean_profiles

+ 	# and do a proper reload instead of restart

+ 	apparmor_restart

+ }

@@ -0,0 +1,28 @@ 

+ # Maintainer: artoo <artoo@artixlinux.org>

+ 

+ pkgname=avahi-openrc

+ pkgver=20220520

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC avahi init script"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('avahi' 'dbus-openrc')

+ conflicts=('systemd-sysvcompat')

+ source=('avahi-daemon.initd'

+         'avahi-dnsconfd.initd'

+         'autoipd-openrc.sh')

+ sha512sums=('f3a0f8e16efc7f70327349146582a49bdf1645b63407f1334ef16a80102850c1fe466bcfc0ae4b6859155ed296787c60a03bfc69713f30676b2b2a198b743b61'

+             'ad1b6ffb336dd8b653d4fd668b7e61f6f6a06628adbedd4db29b755ae66a369bfddddccdbe2acaf13a1ec7640755db91ab831448aa4395f6a756d9ae76e38334'

+             '83b9753a0a7bfceca975a69a07c31af3d2e8ddd37b9459bb7ec65dea566c48932ea641f789f21c7b5ede48473dc4c0316fce4a9be843ecb05a3b1697aa176ae1')

+ 

+ package() {

+   install -Dm755 "${srcdir}"/avahi-daemon.initd   "${pkgdir}"/etc/init.d/avahi-daemon

+   install -Dm755 "${srcdir}"/avahi-dnsconfd.initd "${pkgdir}"/etc/init.d/avahi-dnsconfd

+ 

+   install -Dm755 autoipd-openrc.sh "${pkgdir}"/usr/lib/netifrc/net/autoipd.sh

+ 

+   sed -e 's|/usr/sbin|/usr/bin|g' -i "${pkgdir}/etc/init.d/avahi-daemon"

+   sed -e 's|/usr/sbin|/usr/bin|g' -i "${pkgdir}/etc/init.d/avahi-dnsconfd"

+ }

@@ -0,0 +1,32 @@ 

+ # Copyright (C) 2004-2008 Gentoo Foundation

+ # Distributed under the terms of the GNU General Public License v2

+ # Contributed by Sven Wegener (swegener@gentoo.org)

+ 

+ _config_vars="$_config_vars autoipd"

+ 

+ autoipd_depend() {

+ 	program /usr/bin/avahi-autoipd

+ 	after interface

+ }

+ 

+ autoipd_start() {

+ 	_exists true || return 1

+ 

+         eval args=\$autoipd_${IFVAR}

+ 

+ 	ebegin "Starting avahi-autoipd"

+ 	/usr/bin/avahi-autoipd --daemonize --syslog --wait ${args} "${IFACE}"

+ 	eend "${?}" || return 1

+ 

+ 	_show_address

+ 

+ 	return 0

+ }

+ 

+ autoipd_stop() {

+ 	/usr/bin/avahi-autoipd --check --syslog "${IFACE}" || return 0

+ 

+ 	ebegin "Stopping avahi-autoipd"

+ 	/usr/bin/avahi-autoipd --kill --syslog "${IFACE}"

+ 	eend "${?}"

+ }

@@ -0,0 +1,31 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2007 Gentoo Foundation

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ extra_started_commands="reload"

+ command="/usr/sbin/avahi-daemon"

+ supervisor="supervise-daemon"

+ 

+ depend() {

+ 	before netmount nfsmount

+ 	use net

+ 	need dbus

+ }

+ 

+ # start() {

+ # 	ebegin "Starting avahi-daemon"

+ # 	/usr/bin/avahi-daemon -D

+ # 	eend $?

+ # }

+ #

+ # stop() {

+ # 	ebegin "Stopping avahi-daemon"

+ # 	/usr/bin/avahi-daemon -k

+ # 	eend $?

+ # }

+ 

+ reload() {

+ 	ebegin "Reloading avahi-daemon"

+ 	${command} -r

+ 	eend $?

+ }

@@ -0,0 +1,30 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2007 Gentoo Foundation

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ extra_started_commands="reload"

+ supervisor="supervise-daemon"

+ command="/usr/bin/avahi-dnsconfd"

+ 

+ depend() {

+ 	need avahi-daemon

+ 	use net

+ }

+ 

+ # start() {

+ # 	ebegin "Starting avahi-dnsconfd"

+ # 	/usr/bin/avahi-dnsconfd -D

+ # 	eend $?

+ # }

+ #

+ # stop() {

+ # 	ebegin "Stopping avahi-dnsconfd"

+ # 	/usr/bin/avahi-dnsconfd -k

+ # 	eend $?

+ # }

+ 

+ reload() {

+ 	ebegin "Reloading avahi-dnsconfd"

+ 	${command} -r

+ 	eend $?

+ }

@@ -0,0 +1,22 @@ 

+ # Maintainer: artoo <artoo@artixlinux.org>

+ 

+ pkgname=bind-openrc

+ pkgver=20220520

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC bind init script"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('openrc' 'bind')

+ conflicts=('systemd-sysvcompat')

+ backup=('etc/conf.d/named')

+ source=("named.confd"

+         "named.initd")

+ sha512sums=('68fa7c8963ac59349de3d05972c07aa0123b7bebbe0ba9604463ccfd1b377c2babe01eed4745cbe0f7d3831d1b47c2fa620f8092c67465fb771cae4932b0861a'

+             '0cda69fd663e1847be52d83bfb2749eeffa26b01cbaea5f9e0c9f82d540a13843b1f1f5ad494d29b6aae82ef7ab6c31396bcb4066c33afe2c00e27823cbe7110')

+ 

+ package() {

+     install -Dm755 "${srcdir}"/named.initd "${pkgdir}"/etc/init.d/named

+     install -Dm644 "${srcdir}"/named.confd "${pkgdir}"/etc/conf.d/named

+ }

@@ -0,0 +1,48 @@ 

+ # Set various named options here.

+ #

+ #OPTIONS=""

+ 

+ # Set this to the number of processors you want bind to use.

+ # Leave this unchanged if you want bind to automatically detect the number

+ #CPU="1"

+ 

+ # If you wish to run bind in a chroot:

+ # 1) un-comment the CHROOT= assignment, below. You may use

+ #    a different chroot directory but MAKE SURE it's empty.

+ # 2) run: emerge --config =<bind-version>

+ #

+ #CHROOT="/chroot/dns"

+ 

+ # Uncomment to enable binmount of /usr/share/GeoIP

+ #CHROOT_GEOIP="1"

+ 

+ # Uncomment the line below to avoid that the init script mounts the needed paths

+ # into the chroot directory.

+ # You have to copy all needed config files by hand if you say CHROOT_NOMOUNT="1".

+ #CHROOT_NOMOUNT="1"

+ 

+ # Uncomment this option if you have setup your own chroot environment and you

+ # don't want/need the chroot consistency check

+ #CHROOT_NOCHECK=1

+ 

+ # Default pid file location

+ PIDFILE="${CHROOT}/run/named/named.pid"

+ 

+ # Scheduling priority: 19 is the lowest and -20 is the highest.

+ # Default: 0

+ #NAMED_NICELEVEL="0"

+ 

+ # Uncomment rc_named_use/rc_named_after for the database you need.

+ # Its necessary to ensure the database backend will be started before named.

+ 

+ # MySQL

+ #rc_named_use="mysql"

+ #rc_named_after="mysql"

+ 

+ # PostgreSQL

+ #rc_named_use="pg_autovacuum postgresql"

+ #rc_named_after="pg_autovacuum postgresql"

+ 

+ # LDAP

+ #rc_named_use="ldap"

+ #rc_named_after="ldap"

@@ -0,0 +1,252 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2014 Gentoo Foundation

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ extra_commands="checkconfig checkzones"

+ extra_started_commands="reload"

+ 

+ depend() {

+ 	need net

+ 	use logger

+ 	provide dns

+ }

+ 

+ NAMED_CONF=${CHROOT}/etc/named.conf

+ 

+ OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}

+ MOUNT_CHECK_TIMEOUT=${MOUNT_CHECK_TIMEOUT:-60}

+ 

+ _mount() {

+ 	local from

+ 	local to

+ 	local opts

+ 	local ret=0

+ 

+ 	if [ "${#}" -lt 3 ]; then

+ 		eerror "_mount(): to few arguments"

+ 		return 1

+ 	fi

+ 

+ 	from=$1

+ 	to=$2

+ 	shift 2

+ 

+ 	opts="${*}"

+ 	shift $#

+ 

+ 	if [ -z "$(awk "\$2 == \"${to}\" { print \$2 }" /proc/mounts)" ]; then

+ 		einfo "mounting ${from} to ${to}"

+ 		mount ${from} ${to} ${opts}

+ 		ret=$?

+ 

+ 		eend $ret

+ 		return $ret

+ 	fi

+ 

+ 	return 0

+ }

+ 

+ _umount() {

+ 	local dir=$1

+ 	local ret=0

+ 

+ 	if [ -n "$(awk "\$2 == \"${dir}\" { print \$2 }" /proc/mounts)" ]; then

+ 		ebegin "umounting ${dir}"

+ 		umount ${dir}

+ 		ret=$?

+ 

+ 		eend $ret

+ 		return $ret

+ 	fi

+ 

+ 	return 0

+ }

+ 

+ _get_pidfile() {

+ 	# as suggested in bug #107724, bug 335398#c17

+ 	[ -n "${PIDFILE}" ] || PIDFILE=${CHROOT}$(\

+ 			/usr/bin/named-checkconf -p ${CHROOT:+-t} ${CHROOT} ${NAMED_CONF#${CHROOT}} | grep 'pid-file' | cut -d\" -f2)

+ 	[ -z "${PIDFILE}" ] && PIDFILE=${CHROOT}/run/named/named.pid

+ }

+ 

+ check_chroot() {

+ 	if [ -n "${CHROOT}" ]; then

+ 		[ ! -d "${CHROOT}" ] && return 1

+ 		[ ! -d "${CHROOT}/dev" ] || [ ! -d "${CHROOT}/etc" ] || [ ! -d "${CHROOT}/var" ] && return 1

+ 		[ ! -d "${CHROOT}/run" ] || [ ! -d "${CHROOT}/var/log" ] && return 1

+ 		[ ! -d "${CHROOT}/etc/bind" ] || [ ! -d "${CHROOT}/var/bind" ] && return 1

+ 		[ ! -d "${CHROOT}/var/log/named" ] && return 1

+ 		[ ! -c "${CHROOT}/dev/null" ] || [ ! -c "${CHROOT}/dev/zero" ] && return 1

+ 		[ ! -c "${CHROOT}/dev/random" ] && [ ! -c "${CHROOT}/dev/urandom" ] && return 1

+ 		[ "${CHROOT_GEOIP:-0}" -eq 1 ] && [ ! -d "${CHROOT}/usr/share/GeoIP" ] && return 1

+ 		if [ ${OPENSSL_LIBGOST:-0} -eq 1 ]; then

+ 			if [ -d "/usr/lib64" ]; then

+ 				[ ! -d "${CHROOT}/usr/lib64/engines" ] && return 1

+ 			elif [ -d "/usr/lib" ]; then

+ 				[ ! -d "${CHROOT}/usr/lib/engines" ] && return 1

+ 			fi

+ 		fi

+ 	fi

+ 

+ 	return 0

+ }

+ 

+ checkconfig() {

+ 	ebegin "Checking named configuration"

+ 

+ 	if [ ! -f "${NAMED_CONF}" ] ; then

+ 		eerror "No ${NAMED_CONF} file exists!"

+ 		return 1

+ 	fi

+ 

+ 	/usr/bin/named-checkconf ${CHROOT:+-t} ${CHROOT} ${NAMED_CONF#${CHROOT}} || {

+ 		eerror "named-checkconf failed! Please fix your config first."

+ 		return 1

+ 	}

+ 

+ 	eend 0

+ 	return 0

+ }

+ 

+ checkzones() {

+ 	ebegin "Checking named configuration and zones"

+ 	/usr/bin/named-checkconf -z -j ${CHROOT:+-t} ${CHROOT} ${NAMED_CONF#${CHROOT}}

+ 	eend $?

+ }

+ 

+ start() {

+ 	local piddir

+ 

+ 	ebegin "Starting ${CHROOT:+chrooted }named"

+ 

+ 	if [ -n "${CHROOT}" ]; then

+ 		if [ ${CHROOT_NOCHECK:-0} -eq 0 ]; then

+ 			check_chroot || {

+ 				eend 1

+ 				eerror "Your chroot dir ${CHROOT} is inconsistent, please run 'emerge --config net-dns/bind' first"

+ 				return 1

+ 			}

+ 		fi

+ 

+ 		if [ ${OPENSSL_LIBGOST:-0} -eq 1 ]; then

+ 			if [ ! -e /usr/lib/engines/libgost.so ]; then

+ 				eend 1

+ 				eerror "Couldn't find /usr/lib/engines/libgost.so but bind has been built with openssl and libgost support"

+ 				return 1

+ 			fi

+ 			cp -Lp /usr/lib/engines/libgost.so "${CHROOT}/usr/lib/engines/libgost.so" || {

+ 				eend 1

+ 				eerror "Couldn't copy /usr/lib/engines/libgost.so into '${CHROOT}/usr/lib/engines/'"

+ 				return 1

+ 			}

+ 		fi

+ 		cp -Lp /etc/localtime "${CHROOT}/etc/localtime"

+ 

+ 		if [ "${CHROOT_NOMOUNT:-0}" -eq 0 ]; then

+ 			einfo "Mounting chroot dirs"

+ 			_mount /etc/bind ${CHROOT}/etc/bind -o bind

+ 			_mount /var/bind ${CHROOT}/var/bind -o bind

+ 			_mount /var/log/named ${CHROOT}/var/log/named -o bind

+ 			if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then

+ 				_mount /usr/share/GeoIP ${CHROOT}/usr/share/GeoIP -o bind

+ 			fi

+ 		fi

+ 

+ 		# On initial startup, if piddir inside the chroot /run/named

+ 		# Then the .../run part might not exist yet

+ 		checkpath -q -d -o root:root -m 0755 "${piddir}/.."

+ 	fi

+ 

+ 	checkconfig || { eend 1; return 1; }

+ 

+ 	# create piddir (usually /run/named) if necessary, bug 334535

+ 	_get_pidfile

+ 	piddir="${PIDFILE%/*}"

+ 	checkpath -q -d -o root:named -m 0770 "${piddir}" || {

+ 		eerror "Failed to create PID directory at $piddir"

+ 		eend 1

+ 		return 1

+ 	}

+ 

+ 	# In case someone have $CPU set in /etc/conf.d/named

+ 	if [ -n "${CPU}" ] && [ "${CPU}" -gt 0 ]; then

+ 		CPU="-n ${CPU}"

+ 	fi

+ 

+ 	start-stop-daemon --start --pidfile ${PIDFILE} \

+ 		--nicelevel ${NAMED_NICELEVEL:-0} \

+ 		--exec /usr/bin/named \

+ 		-- -u named ${CPU} ${OPTIONS} ${CHROOT:+-t} ${CHROOT}

+ 	eend $?

+ }

+ 

+ stop() {

+ 	local reported=0

+ 

+ 	ebegin "Stopping ${CHROOT:+chrooted }named"

+ 

+ 	# Workaround for now, until openrc's restart has been fixed.

+ 	# openrc doesn't care about a restart() function in init scripts.

+ 	if [ "${RC_CMD}" = "restart" ]; then

+ 		if [ -n "${CHROOT}" -a ${CHROOT_NOCHECK:-0} -eq 0 ]; then

+ 			check_chroot || {

+ 				eend 1

+ 				eerror "Your chroot dir ${CHROOT} is inconsistent, please run 'emerge --config net-dns/bind' first"

+ 				return 1

+ 			}

+ 		fi

+ 

+ 		checkconfig || { eend 1; return 1; }

+ 	fi

+ 

+ 	# -R 10, bug 335398

+ 	_get_pidfile

+ 	start-stop-daemon --stop --retry 10 --pidfile $PIDFILE \

+ 		--exec /usr/bin/named

+ 

+ 	if [ -n "${CHROOT}" ] && [ "${CHROOT_NOMOUNT:-0}" -eq 0 ]; then

+ 		ebegin "Umounting chroot dirs"

+ 

+ 		# just to be sure everything gets clean

+ 		while fuser -s ${CHROOT} 2>/dev/null; do

+ 			if [ "${reported}" -eq 0 ]; then

+ 				einfo "Waiting until all named processes are stopped (max. ${MOUNT_CHECK_TIMEOUT} seconds)"

+ 			elif [ "${reported}" -eq "${MOUNT_CHECK_TIMEOUT}" ]; then

+ 				eerror "Waiting until all named processes are stopped failed!"

+ 				eend 1

+ 				break

+ 			fi

+ 			sleep 1

+ 			reported=$((reported+1))

+ 		done

+ 

+ 		[ "${CHROOT_GEOIP:-0}" -eq 1 ] && _umount ${CHROOT}/usr/share/GeoIP

+ 		_umount ${CHROOT}/etc/bind

+ 		_umount ${CHROOT}/var/log/named

+ 		_umount ${CHROOT}/var/bind

+ 	fi

+ 

+ 	eend $?

+ }

+ 

+ reload() {

+ 	local ret

+ 

+ 	ebegin "Reloading named.conf and zone files"

+ 

+ 	checkconfig || { eend 1; return 1; }

+ 

+ 	_get_pidfile

+ 	if [ -n "${PIDFILE}" ]; then

+ 		start-stop-daemon --pidfile $PIDFILE --signal HUP

+ 		ret=$?

+ 	else

+ 		ewarn "Unable to determine the pidfile... this is"

+ 		ewarn "a fallback mode. Please check your installation!"

+ 

+ 		$RC_SERVICE restart

+ 		ret=$?

+ 	fi

+ 

+ 	eend $ret

+ }

@@ -0,0 +1,22 @@ 

+ # Maintainer: artoo <artoo@artixlinux.org>

+ 

+ pkgname=bitlbee-openrc

+ pkgver=20220521

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC bitlbee init script"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('openrc' 'bitlbee')

+ conflicts=('systemd-sysvcompat')

+ backup=('etc/conf.d/bitlbee')

+ source=("bitlbee.confd"

+         "bitlbee.initd")

+ sha512sums=('7a16de2bc8616ad5667b9e158f083a83c0a0572afab431c2041d4ff673e60e3f01bc29847b857d89f8559265be4f7741b598e93139bf1ba205c5af91a74c3e55'

+             'b6b449486475396347b3fb9593a4a4aa7ef0780cb448abae0d94887e99964e0b51b2fdbd105c05ad374c5f2699f49e88dcc2682662b77c5bc8441646349e58a6')

+ 

+ package() {

+   install -Dm755 "${srcdir}"/bitlbee.initd "${pkgdir}"/etc/init.d/bitlbee

+   install -Dm644 "${srcdir}"/bitlbee.confd "${pkgdir}"/etc/conf.d/bitlbee

+ }

@@ -0,0 +1,7 @@ 

+ # Bitlbee options (see /usr/bin/bitlbee -h)

+ BITLBEE_OPTS=""

+ 

+ # Specify the network services that correspond to "DaemonInterface" and

+ # "ClientInterface" settings in bitlbee.conf. For example, if bound to 0.0.0.0,

+ # this should be set to "net.lo" which provides the loopback interface.

+ rc_need="net.lo"

@@ -0,0 +1,7 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2019 Gentoo Authors

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ command="/usr/bin/bitlbee"

+ pidfile="/run/${RC_SVCNAME}.pid"

+ command_args="-D -P ${pidfile} -u bitlbee ${BITLBEE_OPTS}"

@@ -0,0 +1,18 @@ 

+ # Maintainer: artoo <artoo@artixlinux.org>

+ 

+ pkgname=bluez-openrc

+ pkgver=20220520

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC bluez init script"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('bluez' 'openrc')

+ conflicts=('systemd-sysvcompat')

+ source=("bluetoothd.initd")

+ sha512sums=('f996e18461befb5b6d4435c06a7d7001052af6dcfa41cda2649869ffcaf3b64050af82d11d2d7d41a06803e25bd956e27b5e1c206a6a9364a5d2b2d3291320e6')

+ 

+ package() {

+   install -Dm755 "${srcdir}"/bluetoothd.initd "${pkgdir}"/etc/init.d/bluetoothd

+ }

@@ -0,0 +1,13 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2019 Gentoo Authors

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ supervisor="supervise-daemon"

+ #pidfile="/run/bluetoothd.pid"

+ command="/usr/lib/bluetooth/bluetoothd"

+ #command_background=1

+ 

+ depend() {

+     after coldplug

+     need dbus localmount hostname

+ }

@@ -0,0 +1,18 @@ 

+ # Maintainer: artoo <artoo@artixlinux.org>

+ 

+ pkgname=brltty-openrc

+ pkgver=20220520

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC brltty init script"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('openrc' 'brltty')

+ conflicts=('systemd-sysvcompat')

+ source=("brltty.initd")

+ sha512sums=('8c866bc16a99f0c5900d309ab8eb60ffa52b6a943591acfb2955ac09bc1420768cb7079b9afeba03b66c6df94794f33262baa8f002ead58474c390dff64ffa9d')

+ 

+ package() {

+   install -Dm755 "$srcdir"/brltty.initd "$pkgdir"/etc/init.d/brltty

+ }

@@ -0,0 +1,12 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2019 Gentoo Authors

+ # Distributed under the terms of the GNU General Public License v2

+ 

+ command=/usr/bin/brltty

+ pidfile=/run/brltty.pid

+ command_args="-P ${pidfile} -q"

+ 

+ depend() {

+ 	before *

+ 	after clock

+ }

@@ -0,0 +1,27 @@ 

+ # Maintainer: Nathan Owens <ndowens@artixlinux.org>

+ 

+ pkgname=chrony-openrc

+ pkgver=20220520

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="OpenRC chrony init"

+ arch=('any')

+ url="https://gitea.artixlinux.org/artixlinux/packages-openrc"

+ license=('GPL2')

+ depends=('openrc' 'chrony')

+ conflicts=('systemd-sysvcompat')

+ backup=('etc/conf.d/chrony')

+ source=("chrony.confd"

+         "chrony.initd")

+ sha512sums=('1efa02f6b06aabf62bc34aadeb43279d0962987d3836a5b4bf6ecde45cc3d0fc4e6e72c1280171c6f9e3cc87a29638b2b25a926d8e529c26b0fdd66e905c8fbb'

+             '66366f2f7009408f1d5f5427a9a2f0c8221b6a7a8e5ebd53df74282a72e9fd7ce75c01c05d11db38814af3a6d98034dfa5efc967a85ca9655828b58bdf01f1cf')

+ b2sums=('496483539b15a55c15287178b7df730fe33fe8d7ceda164f362c0dd6cd833bbee84a0a0496586489659075fc10aafed0f221fb78d60804ddd9edd24e71f6d49b'

+         '4e8f80b060bcc7f6f3b0d702f1b85387f6e545c31f315232574bf8ebd5ad2a6604a80a994ba629ffe419776a29339d894f0c1c7db78e9cd6fb4dc4761cf2c398')

+ 

+ 

+ package() {

+   install -Dm755 "${srcdir}"/chrony.initd "${pkgdir}"/etc/init.d/chrony

+   install -Dm644 "${srcdir}"/chrony.confd "${pkgdir}"/etc/conf.d/chrony

+ 

+   sed -e 's|/etc/chrony/|/etc/|' -i "${pkgdir}/etc/init.d/chrony"

+ }

@@ -0,0 +1,17 @@ 

+ # /etc/conf.d/chronyd

+ 

+ CFGFILE="/etc/chrony.conf"

+ 

+ # chronyd takes some time to perform a second fork, by enabling this

+ # option chronyd is deamonized through start-stop-daemon(1) thereby

+ # significantly reducing the startup time.

+ FAST_STARTUP=yes

+ 

+ # Configuration dependant options :

+ #      -s - Set system time from RTC if rtcfile directive present

+ #      -r - Reload sample histories if dumponexit directive present

+ #

+ # The combination of "-s -r" allows chronyd to perform long term averaging of

+ # the gain or loss rate across system reboots and shutdowns.

+ 

+ ARGS=""

@@ -0,0 +1,78 @@ 

+ #!/usr/bin/openrc-run

+ # Copyright 1999-2007 Gentoo Foundation

+ # Distributed under the terms of the GNU General Public License v2

+ # $Header: /var/cvsroot/gentoo-x86/net-misc/chrony/files/chronyd.rc,v 1.8 2007/03/22 14:32:09 tove Exp $

+ 

+ command="/usr/bin/chronyd"

+ description="NTP daemon"

+ pidfile="/run/chrony/chronyd.pid"

+ 

+ depend() {

+ 	need net

+ 	after firewall

+ 	provide ntp-client ntp-server

+ 	use dns

+ }

+ 

+ checkconfig() {

+ 	# Note that /etc/chrony/chrony.keys is *NOT* checked. This

+ 	# is because the user may have specified another key

+ 	# file, and we don't want to force the user to use that

+ 	# exact name for the key file.

+ 	if [ ! -f "${CFGFILE}" ] ; then

+ 		eerror "Please create ${CFGFILE} and the"

+ 		eerror "chrony key file (usually /etc/chrony/chrony.keys)"

+ 		eerror "by using the"

+ 		eerror ""

+ 		eerror "        chrony.conf.example"

+ 		eerror "        chrony.keys.example"

+ 		eerror ""

+ 		eerror "files (from the documentation directory)"

+ 		eerror "as templates."

+ 		return 1

+ 	else

+ 		# Actually, I tried it, and chrony seems to ignore the pidfile

+ 		# option. I'm going to leave it here anyway, since you never

+ 		# know if it might be handy

+ 		_cfg_pidfile=`awk '/^ *pidfile/{print $2}' "${CFGFILE}"`

+ 		if [ -n "$_cfg_pidfile" ] ; then

+ 			pidfile="$_cfg_pidfile"

+ 		fi

+ 	fi

+ 	return 0

+ }

+ 

+ setxtrarg() {

+ 	if [ -c /dev/rtc ]; then

+ 		grep -q '^rtcfile' "${CFGFILE}" && ARGS="${ARGS} -s"

+ 	fi

+ 	grep -q '^dumponexit$' "${CFGFILE}" && ARGS="${ARGS} -r"

+ 	return 0

+ }

+ 

+ start() {

+ 	checkconfig || return $?

+ 	setxtrarg

+ 

+ 	local daemon_args=

+ 	if yesno "$FAST_STARTUP"; then

+ 		ARGS="${ARGS} -n"

+ 		daemon_args="--background"

+ 	fi

+ 

+ 	ebegin "Starting chronyd"

+ 	start-stop-daemon $daemon_args --start --quiet \

+ 		--exec "${command}" \

+ 		--pidfile "${pidfile}" \

+ 		-- -f "${CFGFILE}" ${ARGS}

+ 	eend $? "Failed to start chronyd"

+ }

+ 

+ stop() {

+ 	checkconfig || return $?

+ 

+ 	ebegin "Stopping chronyd"

+ 	start-stop-daemon --stop --quiet \

+ 		--pidfile "${pidfile}"

+ 	eend $? "Failed to stop chronyd"

+ }

@@ -0,0 +1,24 @@ 

+ # Maintainer: Nathan Owens <ndowens @ artixlinux.org>

+ 

+ pkgname=clamav-openrc

+ pkgver=20220521

+ pkgrel=1

+ pkgrel+=.nonsystemd1

+ pkgdesc="Clamav openrc init script"