0.6 C
New York
Friday, December 27, 2024

homebrew – PostgreSQL Daemon Not Working


I am having hassle making a profitable daemon. Earlier than PostgreSQL went to naming their folders with an @ image, I had a working daemon, however now one thing, someplace has modified that I am unable to determine.

If I run:

sudo -u _systemuser /choose/homebrew/choose/postgresql@14/bin/postgres -D /choose/homebrew/var/postgresql@14

PostgreSQL begins positive.

Nonetheless this plist would not work:

<?xml model="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist model="1.0">
<dict>
    <key>Label</key>
    <string>homebrew.mxcl.postgresql</string>
    <key>RunAtLoad</key>
    <true/>
    <key>GroupName</key>
    <string>_systemuser</string>
    <key>UserName</key>
    <string>_systemuser</string>
    <key>ProgramArguments</key>
    <array>
        <string>/choose/homebrew/bin/postgres</string>
        <string>-D</string>
        <string>/choose/homebrew/var/postgres</string>
    </array>
</dict>
</plist>

In LaunchControl, it says “This job has failed for no obvious purpose.”

So if I allow logging:

<?xml model="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist model="1.0">
<dict>
    <key>Label</key>
    <string>homebrew.mxcl.postgresql14</string>
    <key>RunAtLoad</key>
    <true/>
    <key>GroupName</key>
    <string>_systemuser</string>
    <key>UserName</key>
    <string>_systemuser</string>
    <key>ProgramArguments</key>
    <array>
        <string>/choose/homebrew/choose/postgresql@14/bin/postgres</string>
        <string>-D</string>
        <string>/choose/homebrew/var/postgres@14</string>
    </array>
    <key>StandardErrorPath</key>
    <string>/choose/homebrew/var/log/[email protected]</string>
    <key>StandardOutPath</key>
    <string>/choose/homebrew/var/log/[email protected]</string>
</dict>
</plist>

I get the error “Person _systemuser can’t write to the file: “file:///choose/homebrew/var/log/[email protected]“”

I’ve modified the permissions to these folders with:

sudo chown -R _systemuser /choose/homebrew/var/postgresql@14
sudo chgrp -R _systemuser /choose/homebrew/var/postgresql@14

Nonetheless, utilizing this logging plist does evoke a brand new error in LaunchControl:

2024-12-26 11:06:02.649106 <Error> Service couldn't initialize: posix_spawn(/choose/homebrew/choose/postgresql@14/bin/postgres), error 0xd - Permission denied

However as I stated initially, PostgreSQL begins up positive from CLI.

Stumped. Any concepts on what is perhaps the issue?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles