Почему centos перезагружает мою службу (весенняя загрузка, nginx)? - PullRequest
0 голосов
/ 08 мая 2020

Это моя служба (runapp.service) для запуска приложения после перезапуска системы:

[Unit]
Description=Spring Boot Oulinaart
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/java -jar /var/www/oulina/data/newproject-1.0-SNAPSHOT.jar
Restart=on-failure
RestartSec=5s
TimeoutStartSec=0

[Install]
WantedBy=default.target

Я запускаю свою службу следующими командами:

systemctl daemon-reload
systemctl enable runapp.service
systemctl start runapp.service

Часть журнала journalctl --since "10 min a go":

    May 08 13:39:11 194-58-118-141.ovz.vps.regruhosting.ru sshd[30203]: Invalid user berta from 106.12.57.47 port 55164                                           
May 08 13:39:11 194-58-118-141.ovz.vps.regruhosting.ru sshd[30203]: input_userauth_request: invalid user berta [preauth]                                      
May 08 13:39:11 194-58-118-141.ovz.vps.regruhosting.ru sshd[30203]: pam_unix(sshd:auth): check pass; user unknown                                             
May 08 13:39:11 194-58-118-141.ovz.vps.regruhosting.ru sshd[30203]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10
May 08 13:39:13 194-58-118-141.ovz.vps.regruhosting.ru sshd[30203]: Failed password for invalid user berta from 106.12.57.47 port 55164 ssh2                  
May 08 13:39:13 194-58-118-141.ovz.vps.regruhosting.ru sshd[30210]: Invalid user vendeg from 223.247.153.131 port 35690                                       
May 08 13:39:13 194-58-118-141.ovz.vps.regruhosting.ru sshd[30210]: input_userauth_request: invalid user vendeg [preauth]                                     
May 08 13:39:13 194-58-118-141.ovz.vps.regruhosting.ru sshd[30210]: pam_unix(sshd:auth): check pass; user unknown                                             
May 08 13:39:13 194-58-118-141.ovz.vps.regruhosting.ru sshd[30210]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=22
May 08 13:39:15 194-58-118-141.ovz.vps.regruhosting.ru sshd[30210]: Failed password for invalid user vendeg from 223.247.153.131 port 35690 ssh2              
May 08 13:39:15 194-58-118-141.ovz.vps.regruhosting.ru sshd[30210]: Received disconnect from 223.247.153.131 port 35690:11: Bye Bye [preauth]                 
May 08 13:39:15 194-58-118-141.ovz.vps.regruhosting.ru sshd[30210]: Disconnected from 223.247.153.131 port 35690 [preauth]                                    
May 08 13:39:42 194-58-118-141.ovz.vps.regruhosting.ru sshd[30238]: Invalid user ubuntu from 62.234.120.192 port 56178                                        
May 08 13:39:42 194-58-118-141.ovz.vps.regruhosting.ru sshd[30238]: input_userauth_request: invalid user ubuntu [preauth]                                     
May 08 13:39:42 194-58-118-141.ovz.vps.regruhosting.ru sshd[30238]: pam_unix(sshd:auth): check pass; user unknown                                             
May 08 13:39:42 194-58-118-141.ovz.vps.regruhosting.ru sshd[30238]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=62
May 08 13:39:44 194-58-118-141.ovz.vps.regruhosting.ru sshd[30238]: Failed password for invalid user ubuntu from 62.234.120.192 port 56178 ssh2               
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Started Session 1307662 of user root.                                                      
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Started Session 1307663 of user root.                                                      
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Started Session 1307665 of user root.                                                      
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru CROND[30255]: (root) CMD (/usr/local/mgr5/sbin/cron-ispmgr sbin/mgrctl -m ispmgr problems.autosolve >/d
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru CROND[30256]: (root) CMD (/usr/local/mgr5/sbin/cron-ispmgr sbin/mgrctl -m ispmgr periodic >/dev/null 2>
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru CROND[30257]: (root) CMD (/usr/local/mgr5/sbin/cron-core sbin/mgrctl -m core sysinfostat >/dev/null 2>&
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Started Session 1307666 of user root.                                                      
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Started Session 1307667 of user root.                                                      
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru CROND[30258]: (root) CMD (   /opt/php71/bin/php -c /usr/local/mgr5/addon/revisium_antivirus/php.ini /us
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru CROND[30260]: (root) CMD (/usr/local/mgr5/sbin/cron-core sbin/mgrctl -m core problems.autosolve >/dev/n
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Started Session 1307675 of user root.                                                      
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru CROND[30263]: (root) CMD (   /opt/php71/bin/php -c /usr/local/mgr5/addon/revisium_antivirus/php.ini /us
May 08 13:40:01 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: runapp.service: main process exited, code=killed, status=9/KILL                            
May 08 13:40:02 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Unit runapp.service entered failed state.                                                  
May 08 13:40:02 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: runapp.service failed.                                                                     
May 08 13:40:07 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: runapp.service holdoff time over, scheduling restart.                                      
May 08 13:40:07 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Stopped Spring Boot Oulinaart.                                                             
May 08 13:40:07 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Started Spring Boot Oulinaart.                                                             
May 08 13:40:07 194-58-118-141.ovz.vps.regruhosting.ru sshd[30287]: Invalid user kiki from 133.242.155.85 port 57262                                          
May 08 13:40:07 194-58-118-141.ovz.vps.regruhosting.ru sshd[30287]: input_userauth_request: invalid user kiki [preauth]                                       
May 08 13:40:07 194-58-118-141.ovz.vps.regruhosting.ru sshd[30287]: pam_unix(sshd:auth): check pass; user unknown                                             
May 08 13:40:07 194-58-118-141.ovz.vps.regruhosting.ru sshd[30287]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=ww
May 08 13:40:09 194-58-118-141.ovz.vps.regruhosting.ru sshd[30306]: Authentication refused: bad ownership or modes for directory /var/www/oulina/data
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru sshd[30287]: Failed password for invalid user kiki from 133.242.155.85 port 57262 ssh2
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: .   ____          _            __ _ _
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: '  |____| .__|_| |_|_| |_\__, | / / / /
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: =========|_|==============|___/=/_/_/_/
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: :: Spring Boot ::        (v2.2.2.RELEASE)
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:10.672  INFO 30289 --- [           main] c.o.c.ServingWebContentApplicati
May 08 13:40:10 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:10.679  INFO 30289 --- [           main] c.o.c.ServingWebContentApplicati
May 08 13:40:11 194-58-118-141.ovz.vps.regruhosting.ru sshd[30306]: Accepted password for oulina from 37.110.124.162 port 65512 ssh2
May 08 13:40:11 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Created slice User Slice of oulina.
May 08 13:40:11 194-58-118-141.ovz.vps.regruhosting.ru systemd-logind[154]: New session 1308145 of user oulina.
May 08 13:40:11 194-58-118-141.ovz.vps.regruhosting.ru systemd[1]: Started Session 1308145 of user oulina.
May 08 13:40:11 194-58-118-141.ovz.vps.regruhosting.ru sshd[30306]: pam_unix(sshd:session): session opened for user oulina by (uid=0)
May 08 13:40:13 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:13.973  INFO 30289 --- [           main] .s.d.r.c.RepositoryConfiguration
May 08 13:40:14 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:14.249  INFO 30289 --- [           main] .s.d.r.c.RepositoryConfiguration
May 08 13:40:16 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:16.485  INFO 30289 --- [           main] trationDelegate$BeanPostProcesso
May 08 13:40:16 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:16.604  INFO 30289 --- [           main] trationDelegate$BeanPostProcesso
May 08 13:40:16 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:16.615  INFO 30289 --- [           main] trationDelegate$BeanPostProcesso
May 08 13:40:16 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:16.622  INFO 30289 --- [           main] trationDelegate$BeanPostProcesso
May 08 13:40:16 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:16.627  INFO 30289 --- [           main] trationDelegate$BeanPostProcesso
May 08 13:40:16 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:16.647  INFO 30289 --- [           main] trationDelegate$BeanPostProcesso
May 08 13:40:17 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:17.644  INFO 30289 --- [           main] o.s.b.w.embedded.tomcat.TomcatWe
May 08 13:40:17 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:17.690  INFO 30289 --- [           main] o.apache.catalina.core.StandardS
May 08 13:40:17 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:17.693  INFO 30289 --- [           main] org.apache.catalina.core.Standar
May 08 13:40:17 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:17.923  INFO 30289 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[
May 08 13:40:17 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:17.924  INFO 30289 --- [           main] o.s.web.context.ContextLoader   
May 08 13:40:18 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:18.589  INFO 30289 --- [           main] o.f.c.internal.license.VersionPr
May 08 13:40:18 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:18.626  INFO 30289 --- [           main] com.zaxxer.hikari.HikariDataSour
May 08 13:40:19 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:19.780  INFO 30289 --- [           main] com.zaxxer.hikari.HikariDataSour
May 08 13:40:20 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:20.067  INFO 30289 --- [           main] o.f.c.internal.database.Database
May 08 13:40:20 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:20.498  INFO 30289 --- [           main] o.f.core.internal.command.DbVali
May 08 13:40:20 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:20.566  INFO 30289 --- [           main] o.f.core.internal.command.DbMigr
May 08 13:40:20 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:20.568  INFO 30289 --- [           main] o.f.core.internal.command.DbMigr
May 08 13:40:20 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:20.956  INFO 30289 --- [           main] o.hibernate.jpa.internal.util.Lo
May 08 13:40:21 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:21.207  INFO 30289 --- [           main] org.hibernate.Version           
May 08 13:40:21 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:21.680  INFO 30289 --- [           main] o.hibernate.annotations.common.V
May 08 13:40:22 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:22.115  INFO 30289 --- [           main] org.hibernate.dialect.Dialect   
May 08 13:40:25 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:25.249  INFO 30289 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiat
May 08 13:40:25 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:25.279  INFO 30289 --- [           main] j.LocalContainerEntityManagerFac
May 08 13:40:28 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:28.589  WARN 30289 --- [           main] JpaBaseConfiguration$JpaWebConfi
May 08 13:40:29 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:29.444  INFO 30289 --- [           main] o.s.s.web.DefaultSecurityFilterC
May 08 13:40:29 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:29.774  INFO 30289 --- [           main] o.s.s.concurrent.ThreadPoolTaskE
May 08 13:40:31 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:31.091  INFO 30289 --- [           main] s.a.ScheduledAnnotationBeanPostP
May 08 13:40:31 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:31.240  INFO 30289 --- [           main] o.s.b.w.embedded.tomcat.TomcatWe
May 08 13:40:31 194-58-118-141.ovz.vps.regruhosting.ru java[30289]: 2020-05-08 13:40:31.244  INFO 30289 --- [           main] c.o.c.ServingWebContentApplicati

Log netstat -tulnp:

Active Internet connections (only servers)                                                                                                                    
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name                                                              
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      532/mysqld                                                                    
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      456/exim                                                                      
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      477/dovecot                                                                   
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      477/dovecot                                                                   
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/init                                                                        
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      511/nginx: master p                                                           
tcp        0      0 127.0.0.1:8081          0.0.0.0:*               LISTEN      504/httpd                                                                     
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      456/exim                                                                      
tcp        0      0 194.58.118.141:53       0.0.0.0:*               LISTEN      476/named                                                                     
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      476/named                                                                     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      442/sshd                                                                      
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      476/named                                                                     
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      456/exim                                                                      
tcp        0      0 127.0.0.1:48314         0.0.0.0:*               LISTEN      31081/shellinaboxd                                                            
tcp        0      0 194.58.118.141:443      0.0.0.0:*               LISTEN      511/nginx: master p                                                           
tcp        0      0 0.0.0.0:1500            0.0.0.0:*               LISTEN      513/ihttpd                                                                    
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      477/dovecot                                                                   
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      477/dovecot                                                                   
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      440/php-fpm: master                                                           
tcp6       0      0 :::587                  :::*                    LISTEN      456/exim                                                                      
tcp6       0      0 :::111                  :::*                    LISTEN      6221/rpcbind                                                                  
tcp6       0      0 :::8080                 :::*                    LISTEN      31063/java                                                                    
tcp6       0      0 2a00:f940:2:1:2::bda:80 :::*                    LISTEN      511/nginx: master p                                                           
tcp6       0      0 :::465                  :::*                    LISTEN      456/exim                                                                      
tcp6       0      0 :::21                   :::*                    LISTEN      520/proftpd: (accep                                                           
tcp6       0      0 :::53                   :::*                    LISTEN      476/named                                                                     
tcp6       0      0 :::22                   :::*                    LISTEN      442/sshd                                                                      
tcp6       0      0 ::1:953                 :::*                    LISTEN      476/named                                                                     
tcp6       0      0 :::25                   :::*                    LISTEN      456/exim                                                                      
tcp6       0      0 2a00:f940:2:1:2::bd:443 :::*                    LISTEN      511/nginx: master p                                                           
udp        0      0 194.58.118.141:53       0.0.0.0:*                           476/named                                                                     
udp        0      0 127.0.0.1:53            0.0.0.0:*                           476/named                                                                     
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1/init                                                                        
udp        0      0 0.0.0.0:881             0.0.0.0:*                           6221/rpcbind                                                                  
udp6       0      0 :::53                   :::*                                476/named                                                                     
udp6       0      0 :::111                  :::*                                6221/rpcbind                                                                  
udp6       0      0 :::881                  :::*                                6221/rpcbind

Почему мой сервис завершается каждые 10-20 минут? И я вижу в journalctl только это сообщение:

runapp.service: main process exited, code=killed, status=9/KILL

OS centos7-x86_64_isp_lite5. Порт для весны 8080 (по умолчанию). Спасибо за ответы!

1 Ответ

0 голосов
/ 12 мая 2020

Я нашел решение. На моем сервере было 512 МБ ОЗУ. При проверке free-m стабильно занимали 420 и более из них. Сервер перестал падать, когда я увеличил его до 1 ГБ. Журналы команды "top" (после увеличения RAM) показаны ниже: enter image description here

...