[JIRA] (JENKINS-41218) Provide native systemd unit

2020-05-11 Thread 'axmetishe+jenkins...@gmail.com (JIRA)' via Jenkins Issues
Title: Message Title


 
 
 
 

 
 
 

 
   
 Eugene Ahmethanov commented on  JENKINS-41218  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Provide native systemd unit   
 

  
 
 
 
 

 
 Dirk Heinrichs not be part of the Jenkins package, but the Tomcat one, right? not Jenkins, nor Tomcat - environment specific configuration   Also, the "EnvironmentFile" entry is there for providing some kind of backwards compatibility with system v wrong - this is not a backward compatibility level, but conscious way to pass basic deployment configuration instead of large unit file with tons of Environment definitions which will not be updated from place to place   In a pure systemd setup they shouldn't be used anymore as environment variables wrong again - it's a just two different methods for environment configuration for 'pure' systemd setup   Customizations should then go into /etc/systemd/system/myservice.service.d/*.conf customization will still be applied even using EnvironmentFile which is related to general configuration - https://www.freedesktop.org/software/systemd/man/systemd.exec.html   This completely eliminates the need for ANY distribution specific files You will still have to do some customization with deb/rpm packaging at pre-inst/post-inst for example and string replacement will be the lesser problem   I'll try to write a native service file for standalone Jenkins, I already have one for starting swarm agents which I can use as a starting point Glad to hear that.   Regards.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an 

[JIRA] (JENKINS-41218) Provide native systemd unit

2020-05-11 Thread 'dirk.heinri...@recommind.com (JIRA)' via Jenkins Issues
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dirk Heinrichs commented on  JENKINS-41218  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Provide native systemd unit   
 

  
 
 
 
 

 
 Eugene Ahmethanov, but still, this way of starting Jenkins should not be part of the Jenkins package, but the Tomcat one, right? Also, the "EnvironmentFile" entry is there for providing some kind of backwards compatibility with system v. In a pure systemd setup they shouldn't be used anymore as environment variables can be added directly via "Environment" entries. Customizations should then go into /etc/systemd/system/myservice.service.d/*.conf. This completely eliminates the need for ANY distribution specific files. I'll try to write a native service file for standalone Jenkins, I already have one for starting swarm agents which I can use as a starting point...  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.177980.148483898.24564.1589185500348%40Atlassian.JIRA.


[JIRA] (JENKINS-41218) Provide native systemd unit

2020-05-11 Thread 'axmetishe+jenkins...@gmail.com (JIRA)' via Jenkins Issues
Title: Message Title


 
 
 
 

 
 
 

 
   
 Eugene Ahmethanov commented on  JENKINS-41218  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Provide native systemd unit   
 

  
 
 
 
 

 
 Dirk Heinrichs The above is for running Jenkins in Tomcat, isn't it? Yes. The example provided based on [Advanced Configuration - Multiple Tomcat Instances|https://tomcat.apache.org/tomcat-8.0-doc/RUNNING.txt] - e.g. single installation and "n" - Tomcat Server instances, which allow to run NOT multiple applications within single server(which is also possible by default), but multiple Tomcat Server instances. This is widely used technique when you desire to split up different application servers but share binaries between them. Unit template "tomcat@.service" follow the described flow above: 
 
Determines current default Tomcat binaries(configured via alternatives) directory and expose required variable  ExecStartPre=/bin/bash -c 'systemctl set-environment CATALINA_HOME=$(readlink -f /usr/bin/tomcat)' 
Retrieves server instance configuration(RedHat or Debian makes no difference here, just replace 'sysconfig' to 'default' on deb packaging stage) EnvironmentFile=-/etc/sysconfig/%i 
Starts dedicated Tomcat Instance for Jenkins 
 This kind of configuration provides flexibility on Servlet container configuration, protocols configuration used for proxy communication, simple server and java versions updates, and simplicity for multiple server configuration(dev/int/stage/prod instances) when you are on bare-metal/virtual machines. So setting up a "tomcat@.service" for single webapps doesn't seem to be necessary at all For the configuration when the single app should have its own server.   One that starts Jenkins standalone, just like the current sys-v init script does. I'd left this advanced java app deployment configuration here for someone who tried to find systemd solution from the maintainers. Feel free to switch this unit to the internal winstone(jetty) servlet container used at Jenkins war/jar binaries. Regards.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 

[JIRA] (JENKINS-41218) Provide native systemd unit

2020-05-11 Thread 'dirk.heinri...@recommind.com (JIRA)' via Jenkins Issues
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dirk Heinrichs commented on  JENKINS-41218  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Provide native systemd unit   
 

  
 
 
 
 

 
 The above is for running Jenkins in Tomcat, isn't it? It also seems to be RedHat specific (/etc/sysconfig). When running apps in Tomcat, one usually just need to start Tomcat itself, which in turn takes care of starting all the webapps deployed to it. So setting up a "tomcat@.service" for single webapps doesn't seem to be necessary at all (and also feels wrong given that this would mean to start one Tomcat instance for each webapp configured this way). OTOH, this ticket is about a "native" systemd unit, which I think means: One that starts Jenkins standalone, just like the current sys-v init script does.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.177980.148483898.24485.1589178120431%40Atlassian.JIRA.


[JIRA] (JENKINS-41218) Provide native systemd unit

2020-05-10 Thread 'ieu...@netdava.com (JIRA)' via Jenkins Issues
Title: Message Title


 
 
 
 

 
 
 

 
   
 Eugen Stan commented on  JENKINS-41218  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Provide native systemd unit   
 

  
 
 
 
 

 
 Hello, What can I/we do to have this fix applied? Systemd has become the defacto service manager across major / all distributions. There are new releases in Debian and RHEL that use systemd. There are great benefits to have apps managed by systemd.  It would be great to have this upstream. Even if it is disabled and we need to `systemctl enable ` it manually.   Looking forward for your feedback.   Thanks  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.177980.148483898.24471.1589176260463%40Atlassian.JIRA.


[JIRA] (JENKINS-41218) Provide native systemd unit

2019-01-15 Thread axmetishe+jenkins...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Eugene Ahmethanov edited a comment on  JENKINS-41218  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Provide native systemd unit   
 

  
 
 
 
 

 
 I'll leave the unit template here for Jenkins within multi-instance tomcat installation, maybe this will be helpful.Only one thing - the internal restart commands like safeRestart or restart cause service to be unavailable since restart command is not correct in such case.{code:java}#/lib/systemd/system/tomcat@.service [Unit]Description=Apache Tomcat service for "%i"After=syslog.target network-online.target[Service]SyslogIdentifier=%iUser=%iGroup=%iPermissionsStartOnly=trueEnvironmentFile=-/etc/sysconfig/%iEnvironment='CATALINA_PID=$MAINPID'ExecStartPre=/bin/bash -c 'systemctl set-environment JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")'ExecStartPre=/bin/bash -c 'systemctl set-environment CATALINA_HOME=$(readlink -f /usr/bin/tomcat)'ExecStart=@/usr/bin/java \$JAVA_OPTS \$JMX_OPTS \$INSTANCE_OPTS \$CATALINA_OPTS \-Djava.endorsed.dirs=${CATALINA_HOME}/endorsed \-Djava.io.tmpdir=${CATALINA_BASE}/temp \-Dcatalina.base=${CATALINA_BASE} \-Dcatalina.home=${CATALINA_HOME} \-classpath ${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \org.apache.catalina.startup.Bootstrap startSuccessExitStatus=143[Install]WantedBy=multi-user.targetAlias=%i.service{code} UPD:Example config file for tomcat@jenkins instance:{code:java}#/etc/sysconfig/jenkinsCATALINA_BASE="/opt/jenkins/app"CATALINA_OPTS="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"JAVA_OPTS="-Xms189M -Xmx1514M -XX:MaxDirectMemorySize=378M -XX:-UseConcMarkSweepGC -XX:+UseSerialGC"JMX_OPTS=""INSTANCE_OPTS="-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true -Djenkins.install.runSetupWizard=false"JENKINS_HOME="/opt/jenkins/data"{code}  Regards.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, 

[JIRA] (JENKINS-41218) Provide native systemd unit

2019-01-15 Thread axmetishe+jenkins...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Eugene Ahmethanov commented on  JENKINS-41218  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Provide native systemd unit   
 

  
 
 
 
 

 
 I'll leave the unit template here for Jenkins within multi-instance tomcat installation, maybe this will be helpful. Only one thing - the internal restart commands like safeRestart or restart cause service to be unavailable since restart command is not correct in such case. 

 

#/lib/systemd/system/tomcat@.service 
[Unit]
Description=Apache Tomcat service for "%i"
After=syslog.target network-online.target

[Service]
SyslogIdentifier=%i

User=%i
Group=%i
PermissionsStartOnly=true

EnvironmentFile=-/etc/sysconfig/%i
Environment='CATALINA_PID=$MAINPID'

ExecStartPre=/bin/bash -c 'systemctl set-environment JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")'
ExecStartPre=/bin/bash -c 'systemctl set-environment CATALINA_HOME=$(readlink -f /usr/bin/tomcat)'

ExecStart=@/usr/bin/java \
$JAVA_OPTS \
$JMX_OPTS \
$INSTANCE_OPTS \
$CATALINA_OPTS \
-Djava.endorsed.dirs=${CATALINA_HOME}/endorsed \
-Djava.io.tmpdir=${CATALINA_BASE}/temp \
-Dcatalina.base=${CATALINA_BASE} \
-Dcatalina.home=${CATALINA_HOME} \
-classpath ${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \
org.apache.catalina.startup.Bootstrap start

SuccessExitStatus=143

[Install]
WantedBy=multi-user.target
Alias=%i.service

 

 Regards.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41218) Provide native systemd unit

2017-01-19 Thread nickbr...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Nicholas Brown created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-41218  
 
 
  Provide native systemd unit   
 

  
 
 
 
 

 
Issue Type: 
  Improvement  
 
 
Assignee: 
 Kohsuke Kawaguchi  
 
 
Components: 
 packaging  
 
 
Created: 
 2017/Jan/19 3:16 PM  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Nicholas Brown  
 

  
 
 
 
 

 
 Currently debian packages (and presumably redhat/suse/etc) ship with old style SysV init.d file. Most distributions are now systemd based, and to be able to make use of it's additional features it would be useful have /lib/systemd/system/jenkins.service file. This would allow features like systemd's restart functionality to work (useful when Jenkins occasionally crashes, etc). See discussion around this here: http://serverfault.com/questions/760552/how-to-use-automatic-restart-with-jenkins-on-systemd Details of how provide both systemd unit file and SysV init file are detailed here: https://wiki.debian.org/Teams/pkg-systemd/Packaging This should be applicable to all distro, and systemd unit most likely the same across them all, as it's much more standardised than each distros SysV init infrastructure. https://github.com/jenkinsci/packaging  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment