-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
better example file for systemd service #22
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,17 +5,24 @@ After=network.target | |
[Service] | ||
Type=simple | ||
LimitNOFILE=65535 | ||
ExecStartPost=/sbin/ip rule add from 127.0.0.1/8 iif lo table 123 | ||
ExecStartPost=/sbin/ip route add local 0.0.0.0/0 dev lo table 123 | ||
ExecStartPost=/sbin/ip -6 rule add from ::1/128 iif lo table 123 | ||
ExecStartPost=/sbin/ip -6 route add local ::/0 dev lo table 123 | ||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_ADMIN | ||
ExecStartPost=+/sbin/ip rule add from 127.0.0.1/8 iif lo table 123 | ||
ExecStartPost=+/sbin/ip route add local 0.0.0.0/0 dev lo table 123 | ||
ExecStartPost=+/sbin/ip -6 rule add from ::1/128 iif lo table 123 | ||
ExecStartPost=+/sbin/ip -6 route add local ::/0 dev lo table 123 | ||
ExecStart=/usr/bin/go-mmproxy -4 127.0.0.1:1000 -6 "[::1]:1000" -allowed-subnets /usr/share/path-prefixes.txt -l 0.0.0.0:1234 | ||
ExecStopPost=/sbin/ip rule del from 127.0.0.1/8 iif lo table 123 | ||
ExecStopPost=/sbin/ip route del local 0.0.0.0/0 dev lo table 123 | ||
ExecStopPost=/sbin/ip -6 rule del from ::1/128 iif lo table 123 | ||
ExecStopPost=/sbin/ip -6 route del local ::/0 dev lo table 123 | ||
ExecStopPost=+/sbin/ip rule del from 127.0.0.1/8 iif lo table 123 | ||
ExecStopPost=+/sbin/ip route del local 0.0.0.0/0 dev lo table 123 | ||
ExecStopPost=+/sbin/ip -6 rule del from ::1/128 iif lo table 123 | ||
ExecStopPost=+/sbin/ip -6 route del local ::/0 dev lo table 123 | ||
Restart=on-failure | ||
RestartSec=10s | ||
User=nobody | ||
Group=nogroup | ||
Environment=USER=nobody HOME=/tmp | ||
ProtectSystem=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. |
||
PrivateTmp=true | ||
WorkingDirectory=/tmp | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User and Group should not be set to nobody/nogroup, instead
DynamicUser=yes
should be used