diff --git a/templates/dhcpcd/INSTALL b/templates/dhcpcd/INSTALL new file mode 100644 index 00000000000..4ce5d475729 --- /dev/null +++ b/templates/dhcpcd/INSTALL @@ -0,0 +1,20 @@ +# +# This script registers the dhcpcd service into the +# 'default' runlevel, as required by OpenRC. +# + +case "${ACTION}" in +pre) + ;; +post) + [ ! -x sbin/rc-update ] && exit 0 + [ ! -x sbin/rc-service ] && exit 0 + + if sbin/rc-service -e udev; then + echo "Registering ${PKGNAME} OpenRC service..." + sbin/rc-update add ${PKGNAME} default + [ $? -ne 0 ] && exit $? + sbin/rc-update -u + fi + ;; +esac diff --git a/templates/dhcpcd/REMOVE b/templates/dhcpcd/REMOVE new file mode 100644 index 00000000000..ee5e566cbc3 --- /dev/null +++ b/templates/dhcpcd/REMOVE @@ -0,0 +1,20 @@ +# +# This script unregisters the dhcpcd service from the +# 'default' runlevel, as required by OpenRC. +# + +case "${ACTION}" in +pre) + [ ! -x sbin/rc-update ] && exit 0 + [ ! -x sbin/rc-service ] && exit 0 + + if sbin/rc-service -e udev; then + echo "Unregistering ${PKGNAME} OpenRC service..." + sbin/rc-update del ${PKGNAME} default + [ $? -ne 0 ] && exit $? + sbin/rc-update -u + fi + ;; +post) + ;; +esac diff --git a/templates/dhcpcd/files/dhcpcd b/templates/dhcpcd/files/dhcpcd deleted file mode 100755 index 68209fccf61..00000000000 --- a/templates/dhcpcd/files/dhcpcd +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# PROVIDE: dhcpcd -# REQUIRE: network -# BEFORE: NETWORKING -# KEYWORD: shutdown - -$_rc_subr_loaded . /etc/rc.subr - -name=dhcpcd -rcvar=$name -command=/sbin/$name -pidfile=/var/run/${name}.pid - -load_rc_config $name -run_rc_command "$1" diff --git a/templates/dhcpcd/files/dhcpcd.rc b/templates/dhcpcd/files/dhcpcd.rc new file mode 100644 index 00000000000..a71733c7b5a --- /dev/null +++ b/templates/dhcpcd/files/dhcpcd.rc @@ -0,0 +1,24 @@ +#!/sbin/runscript +# +# + +command=/sbin/dhcpcd +command_args=-q +pidfile=/var/run/dhcpcd.pid +name="DHCP Client Daemon" + +depend() +{ + provide net + need localmount + use logger + after bootmisc modules + before dns +} + +stop_pre() +{ + if yesno $RC_GOINGDOWN; then + : ${stopsig:=SIGKILL} + fi +} diff --git a/templates/dhcpcd/template b/templates/dhcpcd/template index 83ee857abde..266aac71cff 100644 --- a/templates/dhcpcd/template +++ b/templates/dhcpcd/template @@ -1,11 +1,11 @@ # Template file for 'dhcpcd' pkgname=dhcpcd -version=5.0.0 +version=5.0.1 distfiles="http://roy.marples.name/downloads/dhcpcd/dhcpcd-$version.tar.bz2" build_style=gnu_makefile short_desc="RFC2131 compliant DHCP client" maintainer="Juan RP " -checksum=dcd3e1e07b9ccbb7682562345cc2656c13a41892d44f4cd631c3541aab3ad407 +checksum=8d2a8caa411edf18e9689e54242c6f9874e476e8c20b371e4f4627e9938f466b long_desc=" dhcpcd is a RFC 2131 compliant DHCP client. It's also a RFC 3927 compliant IPv4LL (aka ZeroConf) client. @@ -27,6 +27,6 @@ pre_configure() post_install() { - # Install the rc.d script - install -D -m755 ${FILESDIR}/dhcpcd ${DESTDIR}/etc/rc.d/dhcpcd + # Install the OpenRC service + install -D -m755 ${FILESDIR}/dhcpcd.rc ${DESTDIR}/etc/init.d/dhcpcd }