Skip to content

Instantly share code, notes, and snippets.

@ghostflare76
Last active August 22, 2023 09:39
Show Gist options
  • Save ghostflare76/9db7276f1e133ed0bb1e08847d22a30f to your computer and use it in GitHub Desktop.
Save ghostflare76/9db7276f1e133ed0bb1e08847d22a30f to your computer and use it in GitHub Desktop.
jenkins 서비스 독립 실행
# /etc/jenkins
JENKINS_WAR=/home/cowboy76/sw/available/jenkins.war
JENKINS_HOME=/home/cowboy76/.jenkins
JAVA_ARGS="-Djava.awt.headless=true \
-XX:+UseG1GC \
-Xms1024m \
-Xmx1024m"
JENKINS_ARGS="--httpPort=8080 \
--logfile=/home/sysmgr/log/jenkins/jenkins.log"
# /lib/systemd/system
[Unit]
Description=Jenkins
After=network.target
[Service]
Type=simple
User=cowboy76
Group=cowboy76
EnvironmentFile=/etc/jenkins/jenkins.conf
ExecStart=/home/cowboy76/sw/enabled/jdk11/bin/java $JAVA_ARGS -jar $JENKINS_WAR $JENKINS_ARGS
WorkingDirectory=/home/sysmgr/.jenkins
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start jenkins
sudo systemctl status jenkins
binary로 다운로드시 daemon으로 구성해서 자동 관리
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment