summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2022-06-03 06:20:50 +0100
committerSam James <sam@gentoo.org>2022-06-03 06:29:32 +0100
commit729d3c0a57feff2c9edb4e87136535c133877e4b (patch)
tree510d336f95960fbd021797f7414659d7f7323683 /net-misc/ntpsec/files
parentnet-misc/ntp: improve OpenRC init script for ntpd (diff)
downloadgentoo-729d3c0a57feff2c9edb4e87136535c133877e4b.tar.gz
gentoo-729d3c0a57feff2c9edb4e87136535c133877e4b.tar.bz2
gentoo-729d3c0a57feff2c9edb4e87136535c133877e4b.zip
net-misc/ntpsec: Improve OpenRC 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/828078 Signed-off-by: Brian Evans <grknight@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-misc/ntpsec/files')
-rw-r--r--net-misc/ntpsec/files/ntpd.rc-r323
1 files changed, 23 insertions, 0 deletions
diff --git a/net-misc/ntpsec/files/ntpd.rc-r3 b/net-misc/ntpsec/files/ntpd.rc-r3
new file mode 100644
index 000000000000..68d07237455c
--- /dev/null
+++ b/net-misc/ntpsec/files/ntpd.rc-r3
@@ -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="/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
+}