Skip to content

Commit

Permalink
JENKINS-15178: Enabled log rotation on Mac OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
comuttun committed Mar 3, 2013
1 parent 78807ee commit 430667e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions osx/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 osx/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 osx/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

This comment has been minimized.

Copy link
@lacostej

lacostej Feb 17, 2015

Contributor

Shouldn't the owner / group be specified here ?

I keep having to chown after installing jenkins from pkg.

Probably the same for osx/scripts/postinstall-launchd

_EOT_

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

Expand Down

0 comments on commit 430667e

Please sign in to comment.