rpm -ivh http://yum.pgrpms.org/reporpms/9.0/pgdg-centos-9.0-2.noarch.rpmyum install postgresql90-server postgresql90-contribchkconfig postgresql-90 on/etc/init.d/postgresql-90 initdb
但由于某种原因,我不能将它与service命令一起使用,因为它没有名称,.如果我服务–status-所有我得到以下内容:
master (pID 3095) is running... (pID 3009) is running...rdisc is stopped
甚至只是/etc/init.d/postgresql-90状态:
(pID 3009) is running...
那么我怎么能给它一个名字,这样我每次都不必输入整个init脚本路径?
服务名称只是脚本的名称,即postgresql-90.但是,我刚刚在init脚本上面的命令后面安装了postgres实际上叫做postgresql-9.0,而不是postgresql-90.
$sudo /sbin/service postgresql-9.0 status (pID 16670) is running...
我敢肯定你很想知道它为什么不告诉你服务的名称,不是吗?这是因为/etc/rc.d/init.d/postgresql-9.0没有正确调用函数状态:
status -p /var/run/postmaster-${pgmAJORVERSION}.${PGPORT}.pID
来自/etc/rc.d/init.d/functions:
status() { local base pID pID_file= # Test Syntax. if [ "$#" = 0 ] ; then echo $"Usage: status [-p pIDfile] {program}" return 1 fi ...
因此/etc/rc.d/init.d/postgresql-9.0应该是
status -p /var/run/postmaster-${pgmAJORVERSION}.${PGPORT}.pID$sudo /sbin/service postgresql-9.0 statuspostgresql-9.0 (pID 16670) is running...
并且输出正确:
总结以上是内存溢出为你收集整理的PostgreSQL在CentOS上没有服务名称全部内容,希望文章能够帮你解决PostgreSQL在CentOS上没有服务名称所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)