Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
JENKINS-15178: Enabled log rotation on Mac OSX
Originally-From: jenkins-ci.org/commit/core/430667e42f3e6bf5b90badfbcb1a25626a39277b
  • Loading branch information
comuttun committed Mar 3, 2013
1 parent 52ccf2d commit 67e3f69
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions Library/Application Support/Jenkins/Uninstall.command
Expand Up @@ -12,6 +12,7 @@ sudo rm /Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm -rf /Applications/Jenkins "/Library/Application Support/Jenkins" /Library/Documentation/Jenkins
sudo rm -rf /Users/Shared/Jenkins
sudo rm -rf /var/log/jenkins
sudo rm -f /etc/newsyslog.d/jenkins.conf
sudo dscl . -delete /Users/jenkins
sudo dscl . -delete /Groups/jenkins
pkgutil --pkgs | grep 'org\.jenkins-ci\.' | xargs -n 1 sudo pkgutil --forget
Expand Down
7 changes: 7 additions & 0 deletions scripts/postinstall-launchd
Expand Up @@ -12,6 +12,13 @@ find /Users/Shared/Jenkins \( -not -user daemon -or -not -group daemon \) -print
mkdir -p /var/log/jenkins
chown daemon:daemon /var/log/jenkins

# Enable log rotation by newsyslog
cat <<_EOT_ > /etc/newsyslog.d/jenkins.conf
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
# Rotate jenkins log at midnight, and preserve old logs in 3 days
/var/log/jenkins/jenkins.log 644 3 * \$D0 J
_EOT_

# Load and start the launch daemon
/bin/launchctl load -w ${JENKINS_PLIST}

Expand Down
7 changes: 7 additions & 0 deletions scripts/postinstall-launchd-jenkins
Expand Up @@ -49,6 +49,13 @@ find "$JENKINS_HOMEDIR" \( -not -user jenkins -or -not -group jenkins \) -print0
mkdir -p /var/log/jenkins
chown jenkins:jenkins /var/log/jenkins

# Enable log rotation by newsyslog
cat <<_EOT_ > /etc/newsyslog.d/jenkins.conf
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
# Rotate jenkins log at midnight, and preserve old logs in 3 days
/var/log/jenkins/jenkins.log 644 3 * \$D0 J
_EOT_

# Load and start the launch daemon
/bin/launchctl load -w ${JENKINS_PLIST}

Expand Down

0 comments on commit 67e3f69

Please sign in to comment.