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.
Related Issues (20)
- Protobuf-c does not produce usable output HOT 2
- aws-cdk depends on node, but isn't compatible with current node 21 HOT 2
- Please add icu4c@73 to the list of icu4c tap versions HOT 1
- binutils: Include libiberty in the build HOT 2
- glasskube webbundle is missing HOT 4
- mpv: no audio playing .mkv files when ffmpeg upgraded to 7.0 HOT 4
- Atlantis version command is showing inadequate output
- qt5 [email protected] issue building qt@5 from source HOT 7
- virt-manager --connect HOT 1
- Linux - MPV is missing Wayland dependency HOT 7
- Python: setuptools-scm creates failed vendor build HOT 3
- library not found for -lzstd HOT 4
- pip check: openvino 2024.0.0 requires openvino-telementry, which is not installed HOT 3
- brew install j mismatch hash HOT 1
- incorrect jar reference in tika-server jar script HOT 3
- macOS Sonoma Silicon openssl@3: `libdir` variable in libcrypto.pc incorrect (misses `/lib` suffix) HOT 3
- Warning: Some installed kegs have no formulae! This means they were either deleted or installed manually. You should find replacements for the following formulae: python-flit-core HOT 1
- gdk-pixbuf: xpm support missing since 2.42.11 (now off by default upstream) HOT 3
- Compilation Failure with Clang from Brewed LLVM HOT 7
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.