summaryrefslogtreecommitdiffstats
path: root/contrib/bryan_christianson_1
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 12:48:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 12:48:01 +0000
commitb2d2d555a704148968cb7e566735a2a1b1a2f189 (patch)
tree18549ff498338f40ecf7aa327620abf4c1c3ee43 /contrib/bryan_christianson_1
parentInitial commit. (diff)
downloadchrony-4217f00f70af2a1ae4502e7baee4ae34a400d961.tar.xz
chrony-4217f00f70af2a1ae4502e7baee4ae34a400d961.zip
Adding upstream version 4.5.upstream/4.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'contrib/bryan_christianson_1')
-rw-r--r--contrib/bryan_christianson_1/README.txt103
-rwxr-xr-xcontrib/bryan_christianson_1/chronylogrotate.sh58
-rw-r--r--contrib/bryan_christianson_1/org.chrony-project.chronyc.plist22
-rw-r--r--contrib/bryan_christianson_1/org.chrony-project.chronyd.plist19
4 files changed, 202 insertions, 0 deletions
diff --git a/contrib/bryan_christianson_1/README.txt b/contrib/bryan_christianson_1/README.txt
new file mode 100644
index 0000000..05bdd0c
--- /dev/null
+++ b/contrib/bryan_christianson_1/README.txt
@@ -0,0 +1,103 @@
+Notes for installing chrony on macOS
+Author: Bryan Christianson (bryan@whatroute.net)
+------------------------------------------------
+
+These files are for those admins/users who would prefer to install chrony
+from the source distribution and are intended as guidelines rather than
+being definitive. They can be edited with a plain text editor, such as
+vi, emacs or your favourite IDE (Xcode)
+
+It is assumed you are comfortable with installing software from the
+terminal command line and know how to use sudo to acquire root access.
+
+If you are not familiar with the macOS command line then
+please consider using ChronyControl from http://whatroute.net/chronycontrol.html
+
+ChronyControl provides a gui wrapper for installing these files and sets the
+necessary permissions on each file.
+
+
+Install the chrony software
+---------------------------
+
+You will need xcode and the commandline additions to build and install chrony.
+These can be obtained from Apple's website via the App Store.
+
+cd to the chrony directory
+./configure
+make
+sudo make install
+
+chrony is now installed in default locations (/usr/local/sbin/chronyd,
+/usr/local/bin/chronyc)
+
+Create a chrony.conf file - see the chrony website for details
+
+The support files here assume the following directives are specified in the
+chrony.conf file
+
+keyfile /etc/chrony.d/chrony.keys
+driftfile /var/db/chrony/chrony.drift
+bindcmdaddress /var/db/chrony/chronyd.sock
+logdir /var/log/chrony
+dumpdir /var/db/chrony
+
+Install this file as /etc/chrony.d/chrony.conf and create
+the directories specified in the above directives if they don't exist.
+You will need root permissions to create the directories.
+
+
+Running chronyd
+---------------
+At this point chronyd *could* be run as a daemon. Apple discourage running
+daemons and their preferred method uses the launchd facility. The
+support files here provide a launchd configuration file for chronyd and also
+a shell script and launchd configuration file to rotate the chronyd logs on a daily basis.
+
+
+Support files
+-------------
+Dates and sizes may differ
+-rw-r--r-- 1 yourname staff 2084 4 Aug 22:54 README.txt
+-rwxr-xr-x 1 yourname staff 676 4 Aug 21:18 chronylogrotate.sh
+-rw-r--r-- 1 yourname staff 543 18 Jul 20:10 org.chrony-project.chronyc.plist
+-rw-r--r-- 1 yourname staff 511 19 Jun 18:30 org.chrony-project.chronyd.plist
+
+If you have used chrony support directories other than those suggested, you
+will need to edit each file and make the appropriate changes.
+
+
+Installing the support files
+----------------------------
+
+1. chronylogrotate.sh
+This is a simple shell script that deletes old log files. Unfortunately because
+of the need to run chronyc, the standard macOS logrotation does not work with
+chrony logs.
+
+This script runs on a daily basis under control of launchd and should be
+installed in the /usr/local/bin directory
+
+sudo cp chronylogrotate.sh /usr/local/bin
+sudo chmod +x /usr/local/bin/chronylogrotate.sh
+sudo chown root:wheel /usr/local/bin/chronylogrotate.sh
+
+
+2. org.chrony-project.chronyc.plist
+This file is the launchd plist that runs logrotation each day. You may
+wish to edit this file to change the time of day at which the rotation
+will run, currently 04:05 am
+
+sudo cp org.chrony-project.chronyc.plist /Library/LaunchDaemons
+sudo chown root:wheel /Library/LaunchDaemons/org.chrony-project.chronyc.plist
+sudo chmod 0644 /Library/LaunchDaemons/org.chrony-project.chronyc.plist
+sudo launchctl load -w /Library/LaunchDaemons/org.chrony-project.chronyc.plist
+
+
+3. org.chrony-project.chronyd.plist
+This file is the launchd plist that runs chronyd when the Macintosh starts.
+
+sudo cp org.chrony-project.chronyd.plist /Library/LaunchDaemons
+sudo chown root:wheel /Library/LaunchDaemons/org.chrony-project.chronyd.plist
+sudo chmod 0644 /Library/LaunchDaemons/org.chrony-project.chronyd.plist
+sudo launchctl load -w /Library/LaunchDaemons/org.chrony-project.chronyd.plist
diff --git a/contrib/bryan_christianson_1/chronylogrotate.sh b/contrib/bryan_christianson_1/chronylogrotate.sh
new file mode 100755
index 0000000..f919544
--- /dev/null
+++ b/contrib/bryan_christianson_1/chronylogrotate.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# chronyd/chronyc - Programs for keeping computer clocks accurate.
+#
+# **********************************************************************
+# * Copyright (C) Bryan Christianson 2015
+# *
+# * This program is free software; you can redistribute it and/or modify
+# * it under the terms of version 2 of the GNU General Public License as
+# * published by the Free Software Foundation.
+# *
+# * This program is distributed in the hope that it will be useful, but
+# * WITHOUT ANY WARRANTY; without even the implied warranty of
+# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# * General Public License for more details.
+# *
+# * You should have received a copy of the GNU General Public License along
+# * with this program; if not, write to the Free Software Foundation, Inc.,
+# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# *
+# **********************************************************************
+
+LOGDIR=/var/log/chrony
+
+rotate () {
+ prefix=$1
+
+ rm -f $prefix.log.10
+
+ for (( count=9; count>= 0; count-- ))
+ do
+ next=$(( $count+1 ))
+ if [ -f $prefix.log.$count ]; then
+ mv $prefix.log.$count $prefix.log.$next
+ fi
+ done
+
+ if [ -f $prefix.log ]; then
+ mv $prefix.log $prefix.log.0
+ fi
+}
+
+if [ ! -e "$LOGDIR" ]; then
+ logger -s "missing directory: $LOGDIR"
+ exit 1
+fi
+
+cd $LOGDIR
+
+rotate measurements
+rotate statistics
+rotate tracking
+
+#
+# signal chronyd via chronyc
+/usr/local/bin/chronyc cyclelogs > /dev/null
+
+exit $? \ No newline at end of file
diff --git a/contrib/bryan_christianson_1/org.chrony-project.chronyc.plist b/contrib/bryan_christianson_1/org.chrony-project.chronyc.plist
new file mode 100644
index 0000000..94cee17
--- /dev/null
+++ b/contrib/bryan_christianson_1/org.chrony-project.chronyc.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>org.chrony-project.logrotate</string>
+ <key>KeepAlive</key>
+ <false/>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/bin/sh</string>
+ <string>/usr/local/bin/chronylogrotate.sh</string>
+ </array>
+ <key>StartCalendarInterval</key>
+ <dict>
+ <key>Minute</key>
+ <integer>5</integer>
+ <key>Hour</key>
+ <integer>4</integer>
+ </dict>
+</dict>
+</plist>
diff --git a/contrib/bryan_christianson_1/org.chrony-project.chronyd.plist b/contrib/bryan_christianson_1/org.chrony-project.chronyd.plist
new file mode 100644
index 0000000..e23fc06
--- /dev/null
+++ b/contrib/bryan_christianson_1/org.chrony-project.chronyd.plist
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>org.chrony-project.chronyd</string>
+ <key>Program</key>
+ <string>/usr/local/sbin/chronyd</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>chronyd</string>
+ <string>-n</string>
+ <string>-f</string>
+ <string>/private/etc/chrony.d/chrony.conf</string>
+ </array>
+ <key>KeepAlive</key>
+ <true/>
+</dict>
+</plist>