daemon

start daemon on remote server via Jenkins SSH shell script exits mysteriously

徘徊边缘 提交于 2019-12-09 17:29:51
问题 I have a build job on jenkins that is building my project and after it is done, it opens an ssh shell script on a remote server and transfers files and then stop and starts a daemon. When I stop and start the daemon from the command line on a RHEL server, it executes just fine. When the job executes in jenkins, there are no errors. The daemon stops fine and it starts fine. But shortly after starting, the daemon dies suddenly. sudo service daemonName stop # transfer files. sudo service

docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 16:06:29
故障描述: [root@docker01 ~]# docker run centos docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers). See 'docker run --help'. 解决方案: 修改docker镜像源: docker默认的源为国外官方源,下载速度较慢,可改为国内,加速 方案一 修改或新增 /etc/docker/daemon.json [root@docker01 ~]# vi /etc/docker/daemon.json { "registry-mirrors": ["http://hub-mirror.c.163.com"] } [root@docker01 ~]# systemctl restart docker.service 方案二 修改或新增 /etc/sysconfig/docker,在OPTIONS变量后追加参数 --registry-mirror=https://docker.mirrors.ustc.edu.cn [root

linux(centos)上配置nginx、mysql、php-fpm开机启动

只愿长相守 提交于 2019-12-09 10:45:58
服务器上的Nginx和PHP都是源码编译安装的,不支持类似以前的nginx (start|restart|stop|reload)了。自己动手丰衣足食。以下脚本应该在RHEL, Fedora, CentOS下都适用。 一、Nginx启动脚本/etc/init.d/nginx #!/bin/bash # # Startup script for Nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server # processname: nginx # config: /usr/local/nginx/conf/nginx.conf # pidfile: /usr/local/nginx/logs/nginx.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "

ASP.NET Core RC2 as linux deamon

蹲街弑〆低调 提交于 2019-12-09 09:35:31
问题 I need information about hosting of net core console or asp.net application as linux deamon. Hosting application as Windows Service is already supported by Microsoft.Hosting.WindowsService, but I need something similar for linux deamons. 回答1: I'm running on RHEL, and therefore have chosen to write my own systemd unit files. Here is an example of one I use in conjuction with PostgreSQL (hence the Environment variable). I've stripped out sensitive information for obvious reasons. [Unit]

Docker打包微服务

白昼怎懂夜的黑 提交于 2019-12-08 23:59:08
关于Docker,知其然还要知其所以然,这里安利一篇很不错的文章。 10张图带你深入理解Docker容器和镜像 阅读完以上文章,基本上对Docker有了一个比较好的认识,下面来开始我们的应用。 先声明一下,这里用的版本为1.12.6 一、安装与配置 安装就直接通过yum来安装吧 配置主要要配置阿里的镜像加速器,因为dockerHub为国外的网站,在pull镜像的时候会比较慢 下面官方配置的方法是一个坑,应该是比较久版本的docker的配置方法,我用该方法配置后,无法启动docker,还原后 也无法启动docker,最后重装docker才解决问题。 阿里镜像加速器配置的官方文档 sudo cp -n /lib/systemd/system/docker.service /etc/systemd/system/docker.service sudo sed -i "s|ExecStart=/usr/bin/docker daemon|ExecStart=/usr/bin/docker daemon --registry-mirror=<your accelerate address>|g" /etc/systemd/system/docker.service sudo sed -i "s|ExecStart=/usr/bin/dockerd|ExecStart=/usr/bin

Ubuntu下docker搭建详细教程及问题解决

冷暖自知 提交于 2019-12-08 23:51:38
文章目录 1. 切换到root用户下,更新apt-get 2. 下载docker 3. 查看安装是否成功 4. 下载一个简单docker镜像来验证 5. 运行hello-world镜像 6. 可能出现的问题及解决 6.1. docker version检查出现“Cannot connect to Docker daemon. Is this docker daemon running on this host?” 6.2. 怎么通过root之外的其它用户执行docker命令? 6.3. docker pull hello-world报错:TLS handshake timeout # 系统要求 Ubuntu 64-bit OS and version 3.10以上 # 查看系统版本方法: >uname -r >4.13.0-37-generic # 安装过程:(中间如果出现问题请查看最下边的问题列表) 1. 切换到root用户下,更新apt-get >apt-get update 2. 下载docker 打开terminal运行命令 >apt-get install -y docker.io (通过系统提供的安装包) 或者 >curl -s https://get.docker.com|sh (docker提供的安装方式) 3. 查看安装是否成功 >docker version

IDEA中通过docker插件部署springboot项目

不问归期 提交于 2019-12-08 23:14:51
docker 相关部分 windows 系统 安装/升级Docker客户端 对于Windows 10专业版以下的用户,推荐使用 Docker Toolbox Windows安装文件: http://mirrors.aliyun.com/docker-toolbox/windows/docker-toolbox/ 对于Windows 10专业版以上的用户 推荐使用 Docker for Windows Windows安装文件: http://mirrors.aliyun.com/docker-toolbox/windows/docker-for-windows/ 配置镜像加速器 针对安装了 Docker Toolbox 的用户,您可以参考以下配置步骤: 创建一台安装有 Docker 环境的 Linux 虚拟机,指定机器名称为 default ,同时配置 Docker 加速器地址。 docker-machine create --engine-registry-mirror=https://*****.mirror.aliyuncs.com -d virtualbox default 查看机器的环境配置,并配置到本地,并通过 Docker 客户端访问 Docker 服务。 docker-machine env default eval "$(docker-machine env

Python之threading模块的使用

风流意气都作罢 提交于 2019-12-08 16:40:41
作用:同一个进程空间并发运行多个操作,专业术语简称为:【多线程】 1、任务函数不带参数多线程 #!/usr/bin/env python # -*- coding: utf-8 -*- import threading def worker(): print('worker...') threads = [] for i in range(3): task = threading.Thread(target=worker) threads.append(task) task.start() print(threads) threading_simple.py 运行效果 [root@ mnt]# python3 threading_simple.py worker... worker... worker... [<Thread(Thread-1, stopped 140040860006144)>, <Thread(Thread-2, stopped 140040860006144)>, <Thread(Thread-3, stopped 140040860006144)>] 2 、任务函数带参数多线程 #!/usr/bin/env python # -*- coding: utf-8 -*- import threading def worker(num): print(

How to free memory in the Perl [closed]

最后都变了- 提交于 2019-12-08 14:24:35
问题 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 4 years ago . I have daemon with children on perl. For daemonize i use Proc::Daemon . Control daemon and children connected to DB( DBI lib), childs collect mail via imap ( Mail::IMAPClient lib) too. I undef all variables in code of children, but over time, a child who works more than anyone, consume a lot of memory. ps output

Writing daemon in objective c

♀尐吖头ヾ 提交于 2019-12-08 13:25:03
问题 I need to write a daemon, much like windows service on os x using objective c. Can anyone point to some sample? or guide me about how to do this? 回答1: It's best to write your program in a way that lets it be run in the foreground, and then use external tools and techniques (such as OS X's launchd) to run them detached. This makes your program easier to test and integrate. 来源: https://stackoverflow.com/questions/1840162/writing-daemon-in-objective-c