Comments (7)
I find sing-box -h
output says: the flag --directory
set working directory.
% sing-box -h
Usage:
sing-box [command]
Available Commands:
check Check configuration
completion Generate the autocompletion script for the specified shell
format Format configuration
generate Generate things
geoip GeoIP tools
geosite Geosite tools
help Help about any command
merge Merge configurations
rule-set Manage rule sets
run Run service
tools Experimental tools
version Print current version of sing-box
Flags:
-c, --config stringArray set configuration file path
-C, --config-directory stringArray set configuration directory path
-D, --directory string set working directory
--disable-color disable color output
-h, --help help for sing-box
Use "sing-box [command] --help" for more information about a command.
Without this flag, sing-box will use current dir as working directory if using cmd start, however, when use plist, it causes sing-box couldn't find or create working dir
I add the flag to the plist:
Then sudo brew service restart sing-box
works as expect, success starts sing-box
And sudo brew services
show sing-box started
from homebrew-core.
I don't know why I can't pass commit styles check... Someone can help?
from homebrew-core.
I don't know why I can't pass commit styles check... Someone can help?
I found out: 1st the title is too long, 2nd after reopen PR, commits aren't squashed to one
from homebrew-core.
I think there's a relevant key for this, and macOS actually recommends using it.
From service block methods there is a working_dir
method, which translates into <key>WorkingDirectory</key><string>path/to/working/directory</string>
. Can you try using this and see if it works as intended?
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/sing-box/bin/sing-box</string>
<string>run</string>
<string>--config</string>
<string>/usr/local/etc/sing-box/config.ison</string>
</array>
<key>WorkingDirectory</key>
<string>/usr/local/etc/sing-box</string>
If it works, then an easier fix would be:
service do
[...]
working_dir etc/"sing-box"
end
EDIT: obviously it's working_dir var/"lib/sing-box"
, and that folder needs to be created with (var/"lib/sing-box").mkpath
during install because launchd doesn't create that automatically.
from homebrew-core.
It works
litchi@LitchideMacBookAir 1.8.11 % launchctl list homebrew.mxcl.sing-box
{
"LimitLoadToSessionType" = "Aqua";
"Label" = "homebrew.mxcl.sing-box";
"OnDemand" = false;
"LastExitStatus" = 256;
"Program" = "/usr/local/opt/sing-box/bin/sing-box";
"ProgramArguments" = (
"/usr/local/opt/sing-box/bin/sing-box";
"run";
"--config";
"/usr/local/etc/sing-box/config.json";
);
};
litchi@LitchideMacBookAir 1.8.11 % sudo brew services
Name Status User File
sing-box none root
litchi@LitchideMacBookAir 1.8.11 % cat homebrew.mxcl.sing-box.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.sing-box</string>
<key>LimitLoadToSessionType</key>
<array>
<string>Aqua</string>
<string>Background</string>
<string>LoginWindow</string>
<string>StandardIO</string>
<string>System</string>
</array>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/sing-box/bin/sing-box</string>
<string>run</string>
<string>--config</string>
<string>/usr/local/etc/sing-box/config.json</string>
</array>
<key>WorkingDirectory</key>
<string>/usr/local/etc/sing-box</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
litchi@LitchideMacBookAir 1.8.11 % sudo brew services restart sing-box
Warning: Taking root:admin ownership of some sing-box paths:
/usr/local/Cellar/sing-box/1.8.11/bin
/usr/local/Cellar/sing-box/1.8.11/bin/sing-box
/usr/local/opt/sing-box
/usr/local/opt/sing-box/bin
/usr/local/var/homebrew/linked/sing-box
This will require manual removal of these paths using `sudo rm` on
brew upgrade/reinstall/uninstall.
Warning: sing-box must be run as non-root to start at user login!
==> Successfully started `sing-box` (label: homebrew.mxcl.sing-box)
litchi@LitchideMacBookAir 1.8.11 % launchctl list homebrew.mxcl.sing-box
{
"LimitLoadToSessionType" = "Aqua";
"Label" = "homebrew.mxcl.sing-box";
"OnDemand" = false;
"LastExitStatus" = 256;
"PID" = 20795;
"Program" = "/usr/local/opt/sing-box/bin/sing-box";
"ProgramArguments" = (
"/usr/local/opt/sing-box/bin/sing-box";
"run";
"--config";
"/usr/local/etc/sing-box/config.json";
);
};
litchi@LitchideMacBookAir 1.8.11 % sudo brew services
Name Status User File
sing-box started root /Library/LaunchDaemons/homebrew.mxcl.sing-box.plist
litchi@LitchideMacBookAir 1.8.11 %
from homebrew-core.
So, which one is better😂
from homebrew-core.
Well it has been merged so, if it ain't broke…
from homebrew-core.
Related Issues (20)
- [email protected] fails to install in GitHub runner image HOT 9
- curl 8.8.0 - problem with `--write-out`: error 43 - A libcurl function was given a bad argument HOT 15
- brew install --cask metasploit fail 404 on macOS HOT 1
- psql segfaults from brew linked krb5 HOT 5
- mtr doesn't gives any report output if --port option is used with tcp/ udp. HOT 2
- virt-manager will only run if run with --debug flag HOT 2
- Podman recipe requires `pasta` now as well, or extra configuration to avoid needing `pasta` HOT 3
- gitg: SHA256 mismatch HOT 3
- Including .ruby-version in homebrew-core can force ruby version for Ruby scripts in /opt/homebrew/bin HOT 3
- Conflicting Instructions for Using Homebrew-installed LLVM HOT 2
- `universal-ctags` continuously upgrade to the same version HOT 1
- package ccze not picked up by install command HOT 1
- swi-prolog installed with --HEAD option shows different versions HOT 1
- Missing msbuild in [email protected] breaks SonarQube scanning in our build pipeline HOT 1
- Running formulae `asitop` breaks `[email protected]` permissions HOT 3
- Homebrew curl HTTP/3 support HOT 4
- brew install scikit-image isn't importable from python3.12 HOT 3
- autopsy is not the latest version HOT 2
- `msgpack` formula generates invalid pkg-config file HOT 2
- Mplayer shows movie on a quarter screen only on macOS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebrew-core.