Skip to content

Commit

Permalink
feat: New systemd unit file
Browse files Browse the repository at this point in the history
1. Add systemd/system/v2ray.service .
2. Add systemd/system/[email protected] .
3. Modify the installation path in the BUILD file.

issue v2fly/fhs-install-v2ray#53
  • Loading branch information
dctxmei committed Aug 17, 2020
1 parent a150775 commit 3e612d8
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 45 deletions.
3 changes: 2 additions & 1 deletion release/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ filegroup(
filegroup(
name = "systemd",
srcs = [
"config/systemd/v2ray.service",
"config/systemd/system/v2ray.service",
"config/systemd/system/[email protected]",
],
)

Expand Down
16 changes: 16 additions & 0 deletions release/config/systemd/system/v2ray.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=V2Ray Service
Documentation=https://www.v2fly.org/
After=network.target nss-lookup.target

[Service]
User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
Environment=V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/
ExecStart=/usr/local/bin/v2ray -confdir /usr/local/etc/v2ray/
Restart=on-failure

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions release/config/systemd/system/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=V2Ray Service
Documentation=https://www.v2fly.org/
After=network.target nss-lookup.target

[Service]
User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
Environment=V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/
ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/%i.json
Restart=on-failure

[Install]
WantedBy=multi-user.target
22 changes: 0 additions & 22 deletions release/config/systemd/v2ray.service

This file was deleted.

22 changes: 0 additions & 22 deletions release/config/systemd/[email protected]

This file was deleted.

0 comments on commit 3e612d8

Please sign in to comment.