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 work out.
If I run:
sudo -u _systemuser /decide/homebrew/decide/postgresql@14/bin/postgres -D /decide/homebrew/var/postgresql@14
PostgreSQL begins advantageous.
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>/decide/homebrew/bin/postgres</string>
<string>-D</string>
<string>/decide/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>/decide/homebrew/decide/postgresql@14/bin/postgres</string>
<string>-D</string>
<string>/decide/homebrew/var/postgres@14</string>
</array>
<key>StandardErrorPath</key>
<string>/decide/homebrew/var/log/[email protected]</string>
<key>StandardOutPath</key>
<string>/decide/homebrew/var/log/[email protected]</string>
</dict>
</plist>
I get the error “Person _systemuser can not write to the file: “file:///decide/homebrew/var/log/[email protected]“”
I’ve modified the permissions to these folders with:
sudo chown -R _systemuser /decide/homebrew/var/postgresql@14
sudo chgrp -R _systemuser /decide/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(/decide/homebrew/decide/postgresql@14/bin/postgres), error 0xd - Permission denied
However as I mentioned in the beginning, PostgreSQL begins up advantageous from CLI.
Stumped. Any concepts on what is likely to be the issue?