systemd

Systemd http health check [closed]

十年热恋 提交于 2019-12-23 07:57:22
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I have a service on a Redhat 7.1 which I use systemctl start, stop, restart and status to control. One time the systemctl status returned active, but the application "behind" the service responded http code different from 200. I know that I can use Monit or Nagios to check this and do the systemctl restart - but

set umask for tomcat8 via tomcat.service

喜你入骨 提交于 2019-12-23 07:07:38
问题 I am trying to set a custom umask for a tomcat 8 instance, tried to make it the good way by using the UMask directive in systemd tomcat unit as seen here without luck. I'd like to set a 022 umask cause the company dev needs to access tomcat / application logs and they are not in the same group as the tomcat user.... the crazy thing is that the systemd doc says : Controls the file mode creation mask. Takes an access mode in octal notation. See umask(2) for details. Defaults to 0022. But the

【讲清楚,说明白!】计划任务crontab及企业实战应用

旧巷老猫 提交于 2019-12-23 00:08:42
目录: (一)at计划任务 (二)crontab计划任务 (三)清理临时文件 经验丰富的系统运维工程师可以使得Linux系统在无需人工介入的情况下,在指定的时间段自动启动或停止某些服务或命令,从而实现运维的自动化。尽管我们现在已经有了功能强大的脚本程序来执行一些批处理工作,但是如果仍然需要在每天凌晨两点敲击键盘回车键来执行这个脚本程序,这简直太痛苦了。所以这就使得我们能掌握如何设置服务器的计划任务服务的方法,并拥有把周期性,规律性的工作交给系统自动完成的技能显得尤为重要。 计划任务分为一次性计划任务与周期性计划任务。例如公司人事写了一封放假邮件,计划是在放假前最后一个工作日的上午10点发送全体员工,此时我们所需要的就是一次性计划任务。再如数据库管理员需要在每天凌晨2点对业务数据库进行备份,此时我们所需要的就是通过周期性计划任务解决这个需求。 (一)at计划任务 (1.1)at是属于一次性计划任务,顾名思义,一次计划任务只执行一次,一般用于满足临时的工作需求。我们可以使用at命令实现这种功能,只需要写成“at 时间”的格式就可以了。如果想要查看已设置好但还未执行的一次性计划任务,可以使用“at -l”命令;想要将其删除,可以使用“atrm 任务序号”。在使用at命令来设置一次性计划任务时,默认采用的是交互式方法。 (1.2)第一个使用“atq”或者“at -l

[问题解决] Ubutu下mysql安装预配置

冷暖自知 提交于 2019-12-22 18:03:39
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> sudo apt-get install mysql-client 下列软件包有未满足的依赖关系: 360safeforcnos : 依赖: libcurl3 (>= 7.35.0) 但是它将不会被安装 依赖: libpython2.7 (>= 2.7.6) 但是它将不会被安装 依赖: dde-meta-core (>= 0.2.10~trusty) 但无法安装它 依赖: libpolkit-qt-1-dev (>= 0.103.0) 但是它将不会被安装 依赖: libpolkit-gobject-1-dev (>= 0.105) 但是它将不会被安装 依赖: libpolkit-agent-1-dev (>= 0.105) 但是它将不会被安装 推荐: bdviruslibrary 但无法安装它 mysql-server : 依赖: mysql-server-8.0 但是它将不会被安装 sudo apt --fix-broken install sudo apt-get install mysql-server 正在设置 mysql-server-8.0 (8.0.18-0ubuntu0.19.10.1) ... update-alternatives: 使用 /etc/mysql/mysql.cnf

How to configure ExecStart for Gunicorn without WSGI?

梦想的初衷 提交于 2019-12-22 10:08:39
问题 Systemd and Gunicorn require a wsgi file of some sort as the last arg to ExecStart : http://docs.gunicorn.org/en/latest/deploy.html?highlight=ExecStart#systemd With Django, this was in the main module as wsgi.py : ExecStart=/home/admin/django/bin/gunicorn --config /home/admin/src/gunicorn.py --bind unix:/tmp/api.sock myapp.wsgi But this file obviously doesn't exist when using Sanic and uvloop (I believe the new protocol is called ASGI). I tried substituting it for app.py which unsurprisingly

manjaro系统的回滚操作

南楼画角 提交于 2019-12-22 09:23:04
  作为linux系统的爱好者,自从使用linux后,就喜欢追求新的软件,连系统都换成了滚动升级的版本。manjaro基于arch linux,同时也是kde的支持系统,升级非常频繁。使用了几年,很少碰到升级系统刮掉的情形,但是这次升级后出现了: [developDss nication]# pacman -Syyu :: 正在同步软件包数据库... core 151.7 KiB 353 KiB/s 00:00 [########################] 100% extra 1782.6 KiB 378 KiB/s 00:05 [########################] 100% community 5.2 MiB 1244 KiB/s 00:04 [########################] 100% multilib 176.6 KiB 998 KiB/s 00:00 [########################] 100% :: 正在进行全面系统更新... 警告:lib32-systemd:本地 (244.1-1) 比 multilib 的版本更新 (242.153-2) 警告:plasma5-themes-breath:本地 (0.4.0-3) 比 community 的版本更新 (0.4.0-2) 警告:sddm-breath

running a persistent python script from systemd?

僤鯓⒐⒋嵵緔 提交于 2019-12-22 05:41:58
问题 I have a python script that decodes the input from a usb device and sends commands to a php script. The script works beautifully when run from the console, but I need it to be run on startup. I created a systemd service to start the script, which appears to work well, except that the systemctl start service-name process never returns me to the command prompt. While it is running, I can interact with the input device, exactly as expected. However, if I exit the systemctl start process with ctr

systemd prepending /bin to Environment PATH

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 00:28:54
问题 I'm trying to setup my Bamboo agents as a systemd service. The service file looks like this: [Unit] Description=Atlassian Bamboo Agent After=syslog.target network.target [Service] Type=forking User=bamboo Group=bamboo ExecStart=/opt/bamboo-1/bin/bamboo-agent.sh start ExecStop=/opt/bamboo-1/bin/bamboo-agent.sh stop Environment="PATH=/opt/rh/devtoolset-3/root/bin/:/usr/local/bin:/usr/bin" [Install] WantedBy=multi-user.target When I check the process environment, the PATH is correctly set to

systemd启动的程序不会生成coredump解决

喜欢而已 提交于 2019-12-21 23:21:29
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 今天写了个生成coredump的c++程序,发现单独执行程序时能正常生成coredump文件(ulimit -c设置为unlimited)。 但是在用systemd配置服务启动时发现不会生成coredump文件,systemd的service配置文件里已经添加了 LimitCORE=infinity 参数。 原因及解决办法: 查看coredump配置: # cat /proc/sys/kernel/core_pattern core 发现为默认设置。systemd不生成coredump的原因是因为pattern里没设置路径,加上路径即可,如/tmp/core-%e-%p,即可解决问题 来源: oschina 链接: https://my.oschina.net/u/2610085/blog/3059300

Systemd string escaping

ぃ、小莉子 提交于 2019-12-21 16:56:46
问题 If I run this command /bin/bash -c 'while true;do /usr/bin/etcdctl set my-container "{\"host\": \"1\", \"port\": $(/usr/bin/docker port my-container 5000 | cut -d":" -f2)}" --ttl 60;sleep 45;done' I get back from etcd what I expect {"host":"1", "port":49155} But if I put it in a systemd file ExecStart=/bin/bash -c 'while true;do /usr/bin/etcdctl set my-container "{\"host\": \"1\", \"port\": $(/usr/bin/docker port my-container 5000 | cut -d":" -f2)}" --ttl 60;sleep 45;done' I get back {host:1,