PostgreSQL数据文件权限不对导致开机启动失败的问题
PostgreSQL数据文件权限不对导致开机启动失败的问题 上午开发告知机子重启后DB连接不了了,登进去一开,确实,进程啥的都没有起来。 手工启动: [postgres@develop ~]$ pg_start server starting [postgres@develop ~]$ps -ef|grep postgres www.2cto.com 发
PostgreSQL数据文件权限不对导致开机启动失败的问题
上午开发告知机子重启后DB连接不了了,登进去一开,确实,进程啥的都没有起来。
手工启动:
[postgres@develop ~]$ pg_start
server starting
[postgres@develop ~]$ps -ef|grep postgres
www.2cto.com
发现还是没起来,查看日志,里面有如此报错信息:
[postgres@develop ~]$ tail -f pg_log
FATAL: data directory "/home/postgres/data" has wrong ownership
HINT: The server must be started by the user that owns the data directory.
FATAL: data directory "/home/postgres/data" has wrong ownership
HINT: The server must be started by the user that owns the data directory.
FATAL: data directory "/home/postgres/data" has wrong ownership
HINT: The server must be started by the user that owns the data directory.
FATAL: data directory "/home/postgres/data" has group or world access
DETAIL: Permissions should be u=rwx (0700).
信息给得很详细,postgresql的数据文件权限被改了,起码现在不是0700(只有用户权限)。
返回去一看, 现在果然是777权限了。而且用户的所属也被改了,改成其他用户了。
[postgres@develop ~]$ ll /home/postgres
drwxrwxrwx 14 tomcat ddd 4096 10-29 09:41 data
改回去:
[postgres@develop ~]$chown -R postgres:postgres /home/postgres/data
[postgres@develop ~]$chmod 0700 /home/postgres/data
查看: www.2cto.com
drwx------ 14 postgres postgres 4096 10-29 09:41 data
再启动
[postgres@develop ~]$ pg_start
server starting
正常了。后来了解到是开发的一个误操作,改其他文件的权限的时候把DB文件的用户组权限也改了 。
总结:
默认情况下,PostgreSQL启动时,启动DB用户必须拥有数据文件的所属权限(user权限),且权限不能过大,否则就会报上述错误。其实这是一个安全的保护措施,防止DB文件因为权限开设太大而被其他非允许的用户访问。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



DDREASE is a tool for recovering data from file or block devices such as hard drives, SSDs, RAM disks, CDs, DVDs and USB storage devices. It copies data from one block device to another, leaving corrupted data blocks behind and moving only good data blocks. ddreasue is a powerful recovery tool that is fully automated as it does not require any interference during recovery operations. Additionally, thanks to the ddasue map file, it can be stopped and resumed at any time. Other key features of DDREASE are as follows: It does not overwrite recovered data but fills the gaps in case of iterative recovery. However, it can be truncated if the tool is instructed to do so explicitly. Recover data from multiple files or blocks to a single

It allows users to perform more in-depth operations and customization of the system. Root permission is an administrator permission in the Android system. Obtaining root privileges usually requires a series of tedious steps, which may not be very friendly to ordinary users, however. By enabling root permissions with one click, this article will introduce a simple and effective method to help users easily obtain system permissions. Understand the importance and risks of root permissions and have greater freedom. Root permissions allow users to fully control the mobile phone system. Strengthen security controls, customize themes, and users can delete pre-installed applications. For example, accidentally deleting system files causing system crashes, excessive use of root privileges, and inadvertent installation of malware are also risky, however. Before using root privileges

0.What does this article do? We propose DepthFM: a versatile and fast state-of-the-art generative monocular depth estimation model. In addition to traditional depth estimation tasks, DepthFM also demonstrates state-of-the-art capabilities in downstream tasks such as depth inpainting. DepthFM is efficient and can synthesize depth maps within a few inference steps. Let’s read about this work together ~ 1. Paper information title: DepthFM: FastMonocularDepthEstimationwithFlowMatching Author: MingGui, JohannesS.Fischer, UlrichPrestel, PingchuanMa, Dmytr

When deleting or decompressing a folder on your computer, sometimes a prompt dialog box "Error 0x80004005: Unspecified Error" will pop up. How should you solve this situation? There are actually many reasons why the error code 0x80004005 is prompted, but most of them are caused by viruses. We can re-register the dll to solve the problem. Below, the editor will explain to you the experience of handling the 0x80004005 error code. Some users are prompted with error code 0X80004005 when using their computers. The 0x80004005 error is mainly caused by the computer not correctly registering certain dynamic link library files, or by a firewall that does not allow HTTPS connections between the computer and the Internet. So how about

The performance of JAX, promoted by Google, has surpassed that of Pytorch and TensorFlow in recent benchmark tests, ranking first in 7 indicators. And the test was not done on the TPU with the best JAX performance. Although among developers, Pytorch is still more popular than Tensorflow. But in the future, perhaps more large models will be trained and run based on the JAX platform. Models Recently, the Keras team benchmarked three backends (TensorFlow, JAX, PyTorch) with the native PyTorch implementation and Keras2 with TensorFlow. First, they select a set of mainstream

Facing lag, slow mobile data connection on iPhone? Typically, the strength of cellular internet on your phone depends on several factors such as region, cellular network type, roaming type, etc. There are some things you can do to get a faster, more reliable cellular Internet connection. Fix 1 – Force Restart iPhone Sometimes, force restarting your device just resets a lot of things, including the cellular connection. Step 1 – Just press the volume up key once and release. Next, press the Volume Down key and release it again. Step 2 – The next part of the process is to hold the button on the right side. Let the iPhone finish restarting. Enable cellular data and check network speed. Check again Fix 2 – Change data mode While 5G offers better network speeds, it works better when the signal is weaker

What should I do if my Black Shark phone cannot be turned on? Teach you how to save yourself! In our daily lives, mobile phones have become an indispensable part of us. For many people, the Black Shark mobile phone is a beloved gaming phone. But it is inevitable that you will encounter various problems, one of which is that the phone cannot be turned on. When you encounter such a situation, don't panic. Here are some solutions that I hope will help you. First of all, when the Black Shark phone cannot be turned on, first check whether the phone has enough power. It may be that the phone cannot be turned on due to exhausted battery.

When users download WallpaperEngine for use, some users have a problem that it does not start at startup. This is because the user has not set startup at startup. Users need to find the "Start at startup" option in the "General" tab and turn it on. What should I do if wallpaperengine does not start at startup? Answer: Set startup through the settings menu 1. Open the wallpaperengine wallpaper engine program. 2. Click the menu button in the upper left corner and select the "Settings" option. 3. In the settings menu, find the "General" tab. 4. In the "General" tab, find the "Startup" option. 5. Turn on the "Startup" option so that when your computer starts, wallpapereng
