title: Spring boot application getting shut down in unix environment
body: <p>I am trying to run Spring Boot application (.jar) in Unix environment. It get shut down in some time. The application has REST webservice and scheduler component. The same jar runs fine in IDE &amp; Windows CMD.</p>
  <pre><code>2021-01-13 16:46:16.591  INFO 6346 --- [extShutdownHook] o.s.i.endpoint.EventDrivenConsumer       : Removing {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
  2021-01-13 16:46:16.592  INFO 6346 --- [extShutdownHook] o.s.i.channel.PublishSubscribeChannel    : Channel 'SFTP service.errorChannel' has 0 subscriber(s).
  2021-01-13 16:46:16.592  INFO 6346 --- [extShutdownHook] o.s.i.endpoint.EventDrivenConsumer       : stopped bean '_org.springframework.integration.errorLogger'
  2021-01-13 16:46:16.598  INFO 6346 --- [extShutdownHook] o.s.s.c.ThreadPoolTaskScheduler          : Shutting down ExecutorService 'taskScheduler'
  2021-01-13 16:46:16.601  INFO 6346 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
  </code></pre>
  <p>Scheduler code snippet. I am facing reported issue without scheduler code as well.</p>
  <pre><code>@Component
  Public class Task{
  
  @Autowired
  Private Environment env;
  @Autowired
  Private ConnectionFactory conn;
  
  @Scheduled(fixedRate=1500)
  public void scheduledRun(){
  //monitors map 
  }}
  </code></pre>
  <p>Adding Logger Configuration</p>
  <pre><code>&lt;configuration scan=&quot;true&quot; scanPeriod=&quot;30 seconds&quot;&gt;
  &lt;jmxConfigurator/&gt;
  &lt;include resource=&quot;org/springframework/boot/logging/logback/defaults.xml&quot;/&gt;
  &lt;include resource=&quot;org/springframework/boot/logging/logback/file-appender.xml&quot;/&gt;
  
  &lt;appender name=&quot;SERVICE_DEBUG&quot; class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;
      &lt;file&gt;logs/service-debug.log&lt;/file&gt;
      &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.TimeBasedRollingPolicy&quot;&gt;
          &lt;!-- rollover daily --&gt;
          &lt;fileNamePattern&gt;logs/service-debug-%d{yyyy-MM-dd}.%i.gz&lt;/fileNamePattern&gt;
          &lt;timeBasedFileNamingAndTriggeringPolicy class=&quot;ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP&quot;&gt;
              &lt;!-- or whenever the file size reaches 50MB --&gt;
              &lt;maxFileSize&gt;100MB&lt;/maxFileSize&gt;
          &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;
      &lt;/rollingPolicy&gt;
      &lt;encoder&gt;
          &lt;pattern&gt;%d{dd.MM.yyyy HH:mm:ss.SSS z} [%thread] %X{instructionsId}-%X{fileName} %X{step} %-5level %logger{36} - %msg%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  
  &lt;appender name=&quot;SERVICE_ERROR&quot; class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;
      &lt;file&gt;logs/service-err.log&lt;/file&gt;
      &lt;filter class=&quot;ch.qos.logback.classic.filter.ThresholdFilter&quot;&gt;
          &lt;level&gt;WARN&lt;/level&gt;
      &lt;/filter&gt;
      &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.TimeBasedRollingPolicy&quot;&gt;
          &lt;!-- rollover daily --&gt;
          &lt;fileNamePattern&gt;logs/service-err-%d{yyyy-MM-dd}.%i.gz&lt;/fileNamePattern&gt;
          &lt;timeBasedFileNamingAndTriggeringPolicy class=&quot;ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP&quot;&gt;
              &lt;!-- or whenever the file size reaches 50MB --&gt;
              &lt;maxFileSize&gt;100MB&lt;/maxFileSize&gt;
          &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;
      &lt;/rollingPolicy&gt;
      &lt;encoder&gt;
          &lt;pattern&gt;%d{dd.MM.yyyy HH:mm:ss.SSS z} [%thread] %X{instructionsId}-%X{fileName} %X{step} %-5level %logger{36} - %msg%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  
  &lt;logger name=&quot;trace&quot; level=&quot;TRACE&quot;/&gt;
  &lt;springProfile name=&quot;prod, uat1&quot;&gt;
      &lt;logger name=&quot;com.service&quot; level=&quot;INFO&quot;/&gt;
  &lt;/springProfile&gt;
  &lt;springProfile name=&quot;!prod, !uat1&quot;&gt;
      &lt;logger name=&quot;com.service&quot; level=&quot;DEBUG&quot;/&gt;
      &lt;logger name=&quot;org.hibernate.SQL&quot; level=&quot;DEBUG&quot; additivity=&quot;false&quot;&gt;
          &lt;appender-ref ref=&quot;SERVICE_DEBUG&quot; /&gt;
      &lt;/logger&gt;
  &lt;/springProfile&gt;
  &lt;logger name=&quot;org.springframework&quot; level=&quot;INFO&quot;/&gt;
  &lt;logger name=&quot;org.hibernate&quot; level=&quot;INFO&quot;/&gt;
  
  &lt;root level=&quot;INFO&quot;&gt;
      &lt;appender-ref ref=&quot;SERVICE_DEBUG&quot; /&gt;
      &lt;appender-ref ref=&quot;SERVICE_ERROR&quot; /&gt;
      &lt;appender-ref ref=&quot;FILE&quot;/&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>POM file</p>
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.servicep&lt;/groupId&gt;
  &lt;artifactId&gt;sftpservice&lt;/artifactId&gt;
  &lt;version&gt;1.0.2-SNAPSHOT&lt;/version&gt;
  
  &lt;name&gt;sftp-service&lt;/name&gt;
  &lt;description&gt;SFTP service&lt;/description&gt;
  
  &lt;!-- Properties --&gt;
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;!--&lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;--&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;maven-compiler-plugin.version&gt;3.3&lt;/maven-compiler-plugin.version&gt;
  &lt;/properties&gt;
  
  &lt;!-- Spring Boot Parent to control the version of child dependency--&gt;
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;!--&lt;version&gt;2.0.9.RELEASE&lt;/version&gt;--&gt;
      &lt;version&gt;2.2.0.RELEASE&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;!-- Dependencies to build this service - will be imported in project --&gt;
  &lt;dependencies&gt;
      &lt;!-- Spring web brings all required dependencies to build web application. i.e. REST Service --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;!--Dependency for sftp connection--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.integration&lt;/groupId&gt;
          &lt;artifactId&gt;spring-integration-sftp&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;optional&gt;true&lt;/optional&gt;
      &lt;/dependency&gt;
  
      &lt;!--java library to support the SSH protocols on both the client and server side--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.sshd&lt;/groupId&gt;
          &lt;artifactId&gt;sshd-core&lt;/artifactId&gt;
          &lt;version&gt;1.4.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;!--Unit test dependency--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!--API is used to convert JSON to and from POJO (Plain Old Java Object) using property accessor or using annotations--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
          &lt;!--&lt;version&gt;2.9.8&lt;/version&gt;--&gt;
          &lt;version&gt;2.10.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!--logging--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;version&gt;1.7.25&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.5.9&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpmime&lt;/artifactId&gt;
          &lt;version&gt;4.5.9&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;defaultGoal&gt;spring-boot:run&lt;/defaultGoal&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;addResources&gt;true&lt;/addResources&gt;
  
              &lt;/configuration&gt;
          &lt;/plugin&gt; 
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>