我如何编辑update-rc.d
并将postgresql添加到白名单并在黑名单中评论
nano /usr/sbin/update-rc.d
Blacklist
# postgresql disabled (comment)
#Whitelis
postgresql enabled (add)
以及如何授予postgresql的权限
usermod -a -G aid_inet postgres
更新
命令输出
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up postgresql-9.4 (9.4.6-0+deb8u1) ...
[....] Starting PostgreSQL 9.4 database server: main[....]
The PostgreSQL server failed to start. Please check the log output:
2016-03-15 09:24:51 UTC [15301-1] FATAL: could not create shared memory segment: Function not implemented
2016-03-15 09:24:51 UTC [15301-2] DETAI[FAILiled system call was shmget(key=5432001, size=40, 03600). ... failed!
failed!
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing package postgresql-9.4 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
postgresql-9.4
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
sudo apt-get upgrade 正在读取软件包列表... 完成 正在构建依赖关系树 正在读取状态信息... 完成 正在计算升级... 完成 已升级 0 个,新安装 0 个,要删除 0 个,未升级 0 个。未完全安装或删除 1 个。此操作后,将使用 0 B 的额外磁盘空间。是否要继续?[Y/n] y 正在设置 postgresql-9.4 (9.4.6-0+deb8u1) ... [...] 正在启动 PostgreSQL 9.4 数据库服务器:main [...] PostgreSQL 服务器启动失败。请检查日志输出:2016-03-15 09:24:51 UTC [15301-1] FATAL:无法创建共享内存段:未实现函数 2016-03-15 09:24:51 UTC [15301-2] DETAI[FAILided 系统调用为 shmget(key=5432001,size=40,03600)。... 失败!失败!invoke-rc.d:initscript postgresql,操作“start”失败。dpkg:处理软件包 postgresql-9.4 时出错(--configure):子进程安装后安装脚本返回错误退出状态 1 处理时遇到错误:postgresql-9.4
E: 子进程 /usr/bin/dpkg 返回错误代码 (1)