写在前面:案例.常用.归类.解释说明.(By Jim) Ctrl+C组合键可以生产SIGINT信号Ctrl+Z组合键生产SIGTSTP信号,停止进程后程序仍然留在内存中,能够从停止的地方继续运行. 捕获信号 #!/bin/bash# testing output in a background job trap "echo Haha" SIGINT SIGTERMecho "This is a test program"count=1while [ $count -
Linux systemd资源控制初探 本文记录一次cgroup子目录丢失问题,并简单探索了Linux systemd的资源控制机制. 问题现象 我们希望通过systemd拉起服务并通过cgroup限制其CPU.memory的使用,因此我们新建了一个.service文件,文件里面创建了自己的cgroup目录,设置了cpu.memory限制,然后通过cgexec拉起我们的服务进程.假设我们的服务叫xx,.service文件大概是这样的: [Unit] Description=xx Server D
对于普通Linux机器开关防火墙命令: 1重启后生效 chkconfig iptables off chkconfig iptables on 2即时生效 serivce iptables status service iptables start service iptables stop 对于AIX机器开关防火墙步骤: 命令:smit 输入之后按照图形化操作 Communications Applications And Services——>TCP/IP——>Configure IP
Runtime.getRuntime.exec()执行linux脚本导致程序卡死问题问题: 在Java程序中,通过Runtime.getRuntime().exec()执行一个Linux脚本导致程序被挂住,而在终端上直接执行这个脚本则没有任何问题.原因: 先来看Java代码: public final static void process1(String[] cmdarray) { Process p = null; BufferedReader br = null