summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2022-06-03 06:15:24 +0100
committerSam James <sam@gentoo.org>2022-06-03 06:29:18 +0100
commitd8c9b791ed0c3c23ef26ded620334d55f2587758 (patch)
tree3c8db3c070617afe6f844b9b7d6e039c00b39db3 /net-misc/ntp/files
parentsys-apps/daisydog: improve OpenRC init script (diff)
downloadgentoo-d8c9b791ed0c3c23ef26ded620334d55f2587758.tar.gz
gentoo-d8c9b791ed0c3c23ef26ded620334d55f2587758.tar.bz2
gentoo-d8c9b791ed0c3c23ef26ded620334d55f2587758.zip
net-misc/ntp: improve OpenRC init script for ntpd
The attached script updates a couple things which effectively is the same as the current model however it follows the modular nature of the declarative syntax. Changes: * Removes the duplicating start_stop_daemon_args since --pidfile is automatic with pidfile= * Only have ntpd create the pidfile when forking via command_args_background * Add command_args_foreground for the option not to fork Closes: https://bugs.gentoo.org/828077 Signed-off-by: Brian Evans <grknight@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-misc/ntp/files')
-rw-r--r--net-misc/ntp/files/ntpd.rc-r223
1 files changed, 23 insertions, 0 deletions
diff --git a/net-misc/ntp/files/ntpd.rc-r2 b/net-misc/ntp/files/ntpd.rc-r2
new file mode 100644
index 000000000000..f4608f784615
--- /dev/null
+++ b/net-misc/ntp/files/ntpd.rc-r2
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="ntpd - the network time protocol daemon"
+pidfile="/var/run/ntpd.pid"
+command="/usr/sbin/ntpd"
+command_args="${NTPD_OPTS}"
+command_args_background="-p ${pidfile}"
+command_args_foreground="-n"
+
+depend() {
+ use net dns logger
+ after ntp-client
+}
+
+start_pre() {
+ if [ ! -f /etc/ntp.conf ] ; then
+ eerror "Please create /etc/ntp.conf"
+ return 1
+ fi
+ return 0
+}