我正在尝试在 amazon linux 2023 上安装、配置和启动服务。我已经从源代码postgresql 12
安装了该服务,并在. 我无法启动该服务(我将错误放在下面),是否还需要完成其他配置?谢谢 :)postgresql.service
/usr/lib/systemd/system/
postgresql.service 的内容
systemd unit configuration
#
# This can be installed as a service on new system with
# systemctl enable "$PWD/postgresql.service"
#
# Check status with
# systemctl status postgresql
[Unit]
Description=PostgreSQL database server
[Service]
WorkingDirectory=/usr/lib/systemd/system
ExecStart="/usr/lib/systemd/system/postgresql.service"
TimeoutSec=300
[Install]
WantedBy=multi-user.target
权限:
-rwxr-xr-x. 1 root root 397 Oct 20 11:52 postgresql.service
错误:
× postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Fri 2023-10-20 11:55:36 UTC; 4s ago
Duration: 1ms
Process: 364804 ExecStart=/usr/lib/systemd/system/postgresql.service (code=exited, status=203/EXEC)
Oct 20 11:55:36 ip- systemd[1]: Started postgresql.service - PostgreSQL database server.
Oct 20 11:55:36 ip- systemd[364804]: postgresql.service: Failed to execute /usr/lib/systemd/system/postgresql.service: Exec format error
Oct 20 11:55:36 ip- systemd[364804]: postgresql.service: Failed at step EXEC spawning /usr/lib/systemd/system/postgresql.service: Exec format error
Oct 20 11:55:36 ip systemd[1]: postgresql.service: Main process exited, code=exited, status=203/EXEC
Oct 20 11:55:36 ip- systemd[1]: postgresql.service: Failed with result 'exit-code'.
请注意“权限被拒绝”错误。使用chmod适当地设置权限,或以 su 启动服务。
这完全没有意义。您对尝试将自身作为可执行文件运行的服务有何期望?
更不用说它不是一个有效的可执行文件了。