Skip to content

Instantly share code, notes, and snippets.

@biaocy
Last active December 23, 2020 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biaocy/36944448e75cde86aaff824b9987b624 to your computer and use it in GitHub Desktop.
Save biaocy/36944448e75cde86aaff824b9987b624 to your computer and use it in GitHub Desktop.
Systemd service for naiveproxy
[Unit]
Description=naiveproxy - Make a fortune quietly
Documentation=https://github.com/klzgrad/naiveproxy/blob/master/USAGE.txt
After=network.target nss-lookup.target
Wants=network-online.target
[Service]
# If the version of systemd is 240 or above, then uncommenting Type=exec and commenting out Type=simple
Type=exec
#Type=simple
# Runs as root or add CAP_NET_BIND_SERVICE ability can bind 1 to 1024 port.
# This service runs as root. You may consider to run it as another user for security concerns.
# By uncommenting User=naiveproxy and commenting out User=root, the service will run as user naiveproxy.
User=nobody
#User=naiveproxy
#AmbientCapabilities=CAP_NET_BIND_SERVICE
ExecStart=/usr/local/bin/naive /etc/naiveproxy/config.json
Restart=on-failure
# Don't restart in the case of configuration error
RestartPreventExitStatus=23
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment