代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
Shell
】
查看PostgreSQL的服务状态
作者:
无鸯
/ 发布于
2011/11/29
/
1050
<div>sudo su postgres -c 'pg_ctl status -D /opt/local/var/db/postgresql84/defaultdb' </div> <div>可以使用下面的命令查看Postgresql的服务运行状态: <div id="highlighter_817828" class="syntaxhighlighter bash"> <div class="bar "> <div class="toolbar"><a style="width: 16px; height: 16px" class="item viewSource" title="view source" href="http://www.oschina.net/code/snippet_209431_7392#viewSource">view source</a> <div class="item copyToClipboard"><object id="highlighter_817828_clipboard" title="copy to clipboard" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" type="application/x-shockwave-flash" height="16"> <param name="_cx" value="423" /> <param name="_cy" value="423" /> <param name="FlashVars" value="highlighterId=highlighter_817828" /> <param name="Movie" value="/js/syntax-highlighter-2.1.382/scripts/clipboard.swf" /> <param name="Src" value="/js/syntax-highlighter-2.1.382/scripts/clipboard.swf" /> <param name="WMode" value="Transparent" /> <param name="Play" value="0" /> <param name="Loop" value="-1" /> <param name="Quality" value="High" /> <param name="SAlign" value="" /> <param name="Menu" value="0" /> <param name="Base" value="" /> <param name="AllowScriptAccess" value="always" /> <param name="Scale" value="ShowAll" /> <param name="DeviceFont" value="0" /> <param name="EmbedMovie" value="0" /> <param name="BGColor" value="" /> <param name="SWRemote" value="" /> <param name="MovieData" value="" /> <param name="SeamlessTabbing" value="1" /> <param name="Profile" value="0" /> <param name="ProfileAddress" value="" /> <param name="ProfilePort" value="0" /> <param name="AllowNetworking" value="all" /> <param name="AllowFullScreen" value="false" /></object></div> <a style="width: 16px; height: 16px" class="item printSource" title="print" href="http://www.oschina.net/code/snippet_209431_7392#printSource">print</a><a style="width: 16px; height: 16px" class="item about" title="?" href="http://www.oschina.net/code/snippet_209431_7392#about">?</a></div> </div> <div class="lines"> <div class="line alt1"> <table> <tbody> <tr> <td class="number">1</td> <td class="content">"bash plain">% "bash functions">sudo "bash functions">su "bash plain">postgres -c "bash string">'pg_ctl status -D /opt/local/var/db/postgresql84/defaultdb'</td> </tr> </tbody> </table> </div> </div> </div> 结果如下: <div id="highlighter_275365" class="syntaxhighlighter bash"> <div class="bar show"> <div class="toolbar"><a style="width: 16px; height: 16px" class="item viewSource" title="view source" href="http://www.oschina.net/code/snippet_209431_7392#viewSource">view source</a> <div class="item copyToClipboard"><object id="highlighter_275365_clipboard" title="copy to clipboard" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" type="application/x-shockwave-flash" height="16"> <param name="_cx" value="423" /> <param name="_cy" value="423" /> <param name="FlashVars" value="highlighterId=highlighter_275365" /> <param name="Movie" value="/js/syntax-highlighter-2.1.382/scripts/clipboard.swf" /> <param name="Src" value="/js/syntax-highlighter-2.1.382/scripts/clipboard.swf" /> <param name="WMode" value="Transparent" /> <param name="Play" value="0" /> <param name="Loop" value="-1" /> <param name="Quality" value="High" /> <param name="SAlign" value="" /> <param name="Menu" value="0" /> <param name="Base" value="" /> <param name="AllowScriptAccess" value="always" /> <param name="Scale" value="ShowAll" /> <param name="DeviceFont" value="0" /> <param name="EmbedMovie" value="0" /> <param name="BGColor" value="" /> <param name="SWRemote" value="" /> <param name="MovieData" value="" /> <param name="SeamlessTabbing" value="1" /> <param name="Profile" value="0" /> <param name="ProfileAddress" value="" /> <param name="ProfilePort" value="0" /> <param name="AllowNetworking" value="all" /> <param name="AllowFullScreen" value="false" /></object></div> <a style="width: 16px; height: 16px" class="item printSource" title="print" href="http://www.oschina.net/code/snippet_209431_7392#printSource">print</a><a style="width: 16px; height: 16px" class="item about" title="?" href="http://www.oschina.net/code/snippet_209431_7392#about">?</a></div> </div> <div class="lines"> <div class="line alt1"> <table> <tbody> <tr> <td class="number">1</td> <td class="content">"bash plain">pg_ctl: server is running (PID: 54248)</td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="number">2</td> <td class="content">"bash plain">/opt/"bash functions">local"bash plain">/lib/postgresql84/bin/postgres "bash string">"-D" "bash string">"/opt/local/var/db/postgresql84/defaultdb"</td> </tr> </tbody> </table> </div> </div> </div> </div> <div></div>
试试其它关键字
服务状态
同语言下
.
判断用户输入的是否为IP地址
.
根据web访问日志,封禁请求量异常的IP,如IP在半小时
.
iptables自动屏蔽访问网站频繁的IP
.
批量修改服务器用户密码
.
监控httpd的进程数,根据监控情况做相应处理
.
创建10个用户,并分别设置密码,密码要求10位且包含大
.
Expect实现SSH免交互执行命令
.
输入数字运行相应命令
.
用shell打印示例语句中字母数小于6的单词
.
扫描主机端口状态
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
无鸯
贡献的其它代码
(
2
)
.
查看PostgreSQL的服务状态
.
NSDictionary 的遍历
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3