logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

chronyd.init-r3 (630B)


  1. #!/sbin/openrc-run
  2. # Copyright 1999-2022 Gentoo Authors
  3. # Distributed under the terms of the GNU General Public License v2
  4. command="/usr/sbin/chronyd"
  5. command_user="ntp"
  6. command_args="-f \"${CFGFILE}\" ${ARGS}"
  7. pidfile="/run/chrony/chrony.pid"
  8. capabilities="^cap_sys_time"
  9. no_new_privs="yes"
  10. depend() {
  11. use dns
  12. }
  13. start_pre() {
  14. if [ -c /dev/rtc ]; then
  15. grep -q '^rtcfile' "${CFGFILE}" && ARGS="${ARGS} -s"
  16. fi
  17. grep -q '^dumponexit$' "${CFGFILE}" && ARGS="${ARGS} -r"
  18. grep -q '^cmdport *0$' "${CFGFILE}" || capabilities="${capabilities},^cap_net_bind_service"
  19. checkpath -d -o "${command_user}" /run/chrony || return $?
  20. }